From 6bf2e76444fcf1e4071f927cbcba7ae289f5420e Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 22 Nov 2023 13:16:47 +0100 Subject: [PATCH] wip #6501 @0.25 --- src/CommandLine/Rsync.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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()) { -- 2.39.5