From: Vincent Vanwaelscappel Date: Tue, 17 Sep 2024 09:04:42 +0000 (+0200) Subject: wip #7085 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9e806dd33e61656080742ece1f1fec4a27ec83f1;p=cubist_net.git wip #7085 @2 --- diff --git a/src/Server/SFTP.php b/src/Server/SFTP.php new file mode 100644 index 0000000..b653056 --- /dev/null +++ b/src/Server/SFTP.php @@ -0,0 +1,69 @@ +host = $host; + $this->username = $username; + $this->password = $password; + $this->port = $port; + $this->path = $path; + } + + public function getProtocol() + { + return "SFTP"; + } + + public function getHost() + { + return $this->host; + } + + public function getPort() + { + return $this->port; + } + + public function getUsername() + { + return $this->username; + } + + public function getPassword() + { + return $this->password; + } + + public function getBasePath() + { + return $this->path; + } + + public function getBaseURL() + { + // TODO: Implement getBaseURL() method. + } + + public function getSettings() + { + // TODO: Implement getSettings() method. + } + + public function makeURL($path) + { + // TODO: Implement makeURL() method. + } +} \ No newline at end of file diff --git a/src/Transfer/SFTP.php b/src/Transfer/SFTP.php index 668e99d..a3bce4c 100644 --- a/src/Transfer/SFTP.php +++ b/src/Transfer/SFTP.php @@ -19,6 +19,11 @@ class SFTP extends Driver const DEFAULT_PORT = 22; + public static function getInstance($host, $username, $password, $path, $port = self::DEFAULT_PORT) + { + return new SFTP(new \Cubist\Net\Server\SFTP($host, $username, $password, $path, $port)); + } + protected function synchronizeFiles($source, $dest, $mirror = false, $dryrun = false) { $rclone = new Rclone();