SvnCopyTask.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. *
  15. * This software consists of voluntary contributions made by many individuals
  16. * and is licensed under the LGPL. For more information please see
  17. * <http://phing.info>.
  18. */
  19. require_once 'phing/Task.php';
  20. require_once 'phing/tasks/ext/svn/SvnBaseTask.php';
  21. /**
  22. * Copies a repository from the repository url to another
  23. *
  24. * @version $Id: SvnCopyTask.php 905 2010-10-05 16:28:03Z mrook $
  25. * @package phing.tasks.ext.svn
  26. * @since 2.3.0
  27. */
  28. class SvnCopyTask extends SvnBaseTask
  29. {
  30. private $message = "";
  31. /**
  32. * Sets the message
  33. */
  34. function setMessage($message)
  35. {
  36. $this->message = $message;
  37. }
  38. /**
  39. * Gets the message
  40. */
  41. function getMessage()
  42. {
  43. return $this->message;
  44. }
  45. /**
  46. * The main entry point
  47. *
  48. * @throws BuildException
  49. */
  50. function main()
  51. {
  52. $this->setup('copy');
  53. $this->log("Copying SVN repository from '" . $this->getRepositoryUrl() . "' to '" . $this->getToDir() . "'");
  54. $this->run(array($this->getToDir()), array('message' => $this->getMessage()));
  55. }
  56. }