]> _ Git - cubist_util.git/commitdiff
wip #7328 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Feb 2025 09:14:56 +0000 (10:14 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Feb 2025 09:14:56 +0000 (10:14 +0100)
src/CommandLine/LFTP.php

index 2ed5b84fd6b90beea0afea3c2bac1025d1f8dee7..dffa3b12084e27efd2b571a528f3dff49ed3362b 100644 (file)
@@ -40,9 +40,21 @@ class LFTP extends CloneUserpassProgram
                     'set ftp:ssl-allow false',
                 ]);
                 break;
+            case 'FTPS':
+                $commands = array_merge($commands, [
+                    'set ftp:ssl-allow true',
+                ]);
+                break;
+            case 'FTPES':
+                $commands = array_merge($commands, [
+                    'set ftp:ssl-force true',
+                ]);
+                break;
+            default:
+                break;
         }
 
-        if(is_dir($this->getSrc())) {
+        if (is_dir($this->getSrc())) {
             $commands = array_merge($commands, [
                 'mkdir -p ' . $this->getFinalDest(),
                 'cd ' . $this->getFinalDest(),
@@ -57,7 +69,7 @@ class LFTP extends CloneUserpassProgram
             }
             $commands[] = $mirrorCmd;
         } else {
-            $filename = explode('/',$this->getSrc());
+            $filename = explode('/', $this->getSrc());
             $filename = end($filename);
             $commands = array_merge($commands, [
                 'put ' . $this->getSrc()
@@ -67,7 +79,7 @@ class LFTP extends CloneUserpassProgram
             }
         }
 
-        $this->setArg('c', 'open ftp://'.$this->getUsername().':'.$this->getPassword().'@'.$this->getHost().':'.$this->getPort().' '.implode(';', $commands));
+        $this->setArg('c', 'open ftp://' . $this->getUsername() . ':' . $this->getPassword() . '@' . $this->getHost() . ':' . $this->getPort() . ' ' . implode(';', $commands));
     }
 
     /**