From: Vincent Vanwaelscappel Date: Wed, 12 Feb 2025 09:14:56 +0000 (+0100) Subject: wip #7328 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3def7f420fae022935066c89777f83b3976acfe3;p=cubist_util.git wip #7328 @0.25 --- diff --git a/src/CommandLine/LFTP.php b/src/CommandLine/LFTP.php index 2ed5b84..dffa3b1 100644 --- a/src/CommandLine/LFTP.php +++ b/src/CommandLine/LFTP.php @@ -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)); } /**