]> _ Git - cubist_util.git/commitdiff
wip #6501 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Nov 2023 12:16:47 +0000 (13:16 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Nov 2023 12:16:47 +0000 (13:16 +0100)
src/CommandLine/Rsync.php

index 2aa0901e092e13fcc0aea83bb8c7a899f53cebe8..f9bebe3350c2b525e029ed7cfbda1a6efa1118a3 100644 (file)
@@ -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()) {