From c7b113f8e502ced8204653050cf843fc398fd5d5 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 22 Nov 2023 18:02:12 +0100 Subject: [PATCH] wait #6501 @0.25 --- src/CommandLine/Rsync.php | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) 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); } -- 2.39.5