1 | <?php |
||
23 | class SftpClient extends AbstractFtpClient { |
||
24 | |||
25 | /** |
||
26 | * SFTP resource. |
||
27 | * |
||
28 | * @var resource |
||
29 | */ |
||
30 | private $sftp; |
||
31 | |||
32 | /** |
||
33 | * Constructor. |
||
34 | * |
||
35 | * @param Authenticator $authenticator The authenticator. |
||
36 | */ |
||
37 | public function __construct(Authenticator $authenticator) { |
||
45 | |||
46 | /** |
||
47 | * Close. |
||
48 | * |
||
49 | * @return SftpClient Returns this SFTP client. |
||
50 | * @throws FtpException Throws a FTP exception if an I/O error occurs. |
||
51 | */ |
||
52 | public function close() { |
||
60 | |||
61 | /** |
||
62 | * Connect. |
||
63 | * |
||
64 | * @return SftpClient Returns this SFTP client. |
||
65 | * @throws FtpException Throws a FTP exception if an I/O error occurs. |
||
66 | */ |
||
67 | public function connect() { |
||
79 | |||
80 | /** |
||
81 | * Delete. |
||
82 | * |
||
83 | * @param string $path The path. |
||
84 | * @return SftpClient Returns this SFTP client. |
||
85 | * @throws FtpException Throws a FTP exception if an I/O error occurs. |
||
86 | */ |
||
87 | public function delete($path) { |
||
95 | |||
96 | /** |
||
97 | * Get a file. |
||
98 | * |
||
99 | * @param string $localFile The local file. |
||
100 | * @param string $remoteFile The remote file. |
||
101 | * @return SftpClient Returns this SFTP client. |
||
102 | */ |
||
103 | public function get($localFile, $remoteFile) { |
||
115 | |||
116 | /** |
||
117 | * Get the SFTP resource. |
||
118 | * |
||
119 | * @return resource Returns the SFTP resource. |
||
120 | */ |
||
121 | private function getSftp() { |
||
129 | |||
130 | /** |
||
131 | * Login. |
||
132 | * |
||
133 | * @return SftpClient Returns this SFTP client. |
||
134 | * @throws FtpException Throws a FTP exception if an I/O error occurs. |
||
135 | */ |
||
136 | public function login() { |
||
147 | |||
148 | /** |
||
149 | * Make a directory. |
||
150 | * |
||
151 | * @param string $directory The directory. |
||
152 | * @param int $mode The mode. |
||
153 | * @param bool $recursive Recursively ?. |
||
154 | * @return SftpClient Returns this SFTP client. |
||
155 | * @throws FtpException Throws a FTP exception if an I/O error occurs. |
||
156 | */ |
||
157 | public function mkdir($directory, $mode = 0777, $recursive = false) { |
||
165 | |||
166 | /** |
||
167 | * Put a file. |
||
168 | * |
||
169 | * @param string $localFile The local file. |
||
170 | * @param string $remoteFile The remote file. |
||
171 | * @return SftpClient Returns this SFTP client. |
||
172 | */ |
||
173 | public function put($localFile, $remoteFile) { |
||
185 | |||
186 | /** |
||
187 | * Rename. |
||
188 | * |
||
189 | * @param string $oldName The old name. |
||
190 | * @param string $newName The new name. |
||
191 | * @return SftpClient Returns this SFTP client. |
||
192 | * @throws FtpException Throws a FTP exception if an I/O error occurs. |
||
193 | */ |
||
194 | public function rename($oldName, $newName) { |
||
202 | |||
203 | /** |
||
204 | * Remove a directory. |
||
205 | * |
||
206 | * @param string $directory The directory. |
||
207 | * @return SftpClient Returns this SFTP client. |
||
208 | * @throws FtpException Throws a FTP exception if an I/O error occurs. |
||
209 | */ |
||
210 | public function rmdir($directory) { |
||
218 | } |
||
219 |