From 9e806dd33e61656080742ece1f1fec4a27ec83f1 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 17 Sep 2024 11:04:42 +0200 Subject: [PATCH] wip #7085 @2 --- src/Server/SFTP.php | 69 +++++++++++++++++++++++++++++++++++++++++++ src/Transfer/SFTP.php | 5 ++++ 2 files changed, 74 insertions(+) create mode 100644 src/Server/SFTP.php 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(); -- 2.39.5