From 6ca5713fdfa8dafd10dcc9f35032b268d7c934be Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 16 Jul 2024 18:56:37 +0200 Subject: [PATCH] #7008 @0.25 --- src/Transfer/Local.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Transfer/Local.php b/src/Transfer/Local.php index bba6fdc..2836a7a 100644 --- a/src/Transfer/Local.php +++ b/src/Transfer/Local.php @@ -3,6 +3,7 @@ namespace Cubist\Net\Transfer; use Cubist\Util\CommandLine\Rsync; +use Cubist\Util\Files\Files; class Local extends Driver { @@ -18,7 +19,8 @@ class Local extends Driver } } - protected function synchronizeFiles($source, $dest, $mirror = false, $dryrun = false) { + protected function synchronizeFiles($source, $dest, $mirror = false, $dryrun = false) + { // } @@ -49,8 +51,8 @@ class Local extends Driver public function copy($source, $dest, $mirror = false, $dryrun = false) { - if($this->checkConnexion() !== true) { - throw new \Exception('Unabled to connect to this server (error code : '. $this->checkConnexion() .' )'); + if ($this->checkConnexion() !== true) { + throw new \Exception('Unabled to connect to this server (error code : ' . $this->checkConnexion() . ' )'); } $rsync = new Rsync($source, $dest); $rsync->setServer($this->getServer()); @@ -63,7 +65,7 @@ class Local extends Driver protected function _basePath() { - return rtrim($this->getRootPath(), '/') . '/' . ltrim($this->getServer()->getBasePath(), '/'); + return Files::mkdir(rtrim($this->getRootPath(), '/') . '/' . ltrim($this->getServer()->getBasePath(), '/')); } public function copyFile($source, $dest) @@ -71,8 +73,9 @@ class Local extends Driver return copy($source, $this->_basePath() . '/' . $dest); } - public function checkConnexion($data = []) { - if(file_exists($this->getRootPath().'status')) { + public function checkConnexion($data = []) + { + if (file_exists($this->getRootPath() . 'status')) { return true; } else { return static::ERROR_FOLDER_UNMOUNT; -- 2.39.5