]> _ Git - cubist_net.git/commitdiff
#7008 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jul 2024 16:56:37 +0000 (18:56 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jul 2024 16:56:37 +0000 (18:56 +0200)
src/Transfer/Local.php

index bba6fdc67682348cfc6f7519658f9a2e5fe3217f..2836a7acf7b5d85403531d57117fa0ec063a587e 100644 (file)
@@ -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;