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

index f9bebe3350c2b525e029ed7cfbda1a6efa1118a3..841e3748ae27724a424186bd39b268fa74e4ef98 100644 (file)
@@ -19,6 +19,9 @@ class Rsync extends CloneProgram
 
     protected $_move = false;
 
+    protected $_followSymlinks = false;
+    protected $_copySymlinksAsSymlinks = false;
+
 
     public function getSshKey()
     {
@@ -53,6 +56,38 @@ class Rsync extends CloneProgram
         return $this;
     }
 
+    /**
+     * @param bool $copySymlinksAsSymlinks
+     */
+    public function setCopySymlinksAsSymlinks(bool $copySymlinksAsSymlinks): void
+    {
+        $this->_copySymlinksAsSymlinks = $copySymlinksAsSymlinks;
+    }
+
+    /**
+     * @return bool
+     */
+    public function getCopySymlinksAsSymlinks(): bool
+    {
+        return $this->_copySymlinksAsSymlinks;
+    }
+
+    /**
+     * @param bool $followSymlinks
+     */
+    public function setFollowSymlinks(bool $followSymlinks): void
+    {
+        $this->_followSymlinks = $followSymlinks;
+    }
+
+    /**
+     * @return bool
+     */
+    public function getFollowSymlinks(): bool
+    {
+        return $this->_followSymlinks;
+    }
+
     /**
      * @param bool $move
      */
@@ -115,6 +150,12 @@ class Rsync extends CloneProgram
         $this->setArg('t');
         $this->setArg('r');
         $this->setArg('v');
+        if ($this->getFollowSymlinks()) {
+            $this->setArg('L');
+        }
+        if ($this->getCopySymlinksAsSymlinks()) {
+            $this->setArg('l');
+        }
         foreach ($this->_excludes as $e) {
             $this->setArg('exclude', $e);
         }