From: Vincent Vanwaelscappel Date: Wed, 22 Nov 2023 17:02:12 +0000 (+0100) Subject: wait #6501 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c7b113f8e502ced8204653050cf843fc398fd5d5;p=cubist_util.git wait #6501 @0.25 --- diff --git a/src/CommandLine/Rsync.php b/src/CommandLine/Rsync.php index f9bebe3..841e374 100644 --- a/src/CommandLine/Rsync.php +++ b/src/CommandLine/Rsync.php @@ -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); }