From: Vincent Vanwaelscappel Date: Wed, 22 Nov 2023 12:16:47 +0000 (+0100) Subject: wip #6501 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6bf2e76444fcf1e4071f927cbcba7ae289f5420e;p=cubist_util.git wip #6501 @0.25 --- diff --git a/src/CommandLine/Rsync.php b/src/CommandLine/Rsync.php index 2aa0901..f9bebe3 100644 --- a/src/CommandLine/Rsync.php +++ b/src/CommandLine/Rsync.php @@ -17,6 +17,8 @@ class Rsync extends CloneProgram protected $_sshKey = null; + protected $_move = false; + public function getSshKey() { @@ -51,6 +53,22 @@ class Rsync extends CloneProgram return $this; } + /** + * @param bool $move + */ + public function setMove(bool $move): void + { + $this->_move = $move; + } + + /** + * @return bool + */ + public function getMove(): bool + { + return $this->_move; + } + public function addExclude($exclude) { $this->_excludes[] = $exclude; @@ -104,6 +122,9 @@ class Rsync extends CloneProgram $this->setArg('force'); $this->setArg('delete-after'); } + if ($this->getMove()) { + $this->setArg('remove-source-files'); + } if ($destDistant) { $ssh = 'ssh -p ' . $port; if (null !== $this->getSshKey()) {