1 | <?php |
||
23 | class SFTPClient extends AbstractFTPClient { |
||
24 | |||
25 | /** |
||
26 | * SFTP resource. |
||
27 | * |
||
28 | * @var mixed |
||
29 | */ |
||
30 | private $sftp; |
||
31 | |||
32 | /** |
||
33 | * Constructor. |
||
34 | * |
||
35 | * @param Authenticator $authenticator The authenticator. |
||
36 | */ |
||
37 | public function __construct(Authenticator $authenticator) { |
||
44 | |||
45 | /** |
||
46 | * Closes this SFTP connection. |
||
47 | * |
||
48 | * @return SFTPClient Returns this SFTP client. |
||
49 | * @throws FTPException Throws a FTP exception if an I/O error occurs. |
||
50 | */ |
||
51 | public function close() { |
||
57 | |||
58 | /** |
||
59 | * Opens this SFTP connection. |
||
60 | * |
||
61 | * @return SFTPClient Returns this SFTP client. |
||
62 | * @throws FTPException Throws a FTP exception if an I/O error occurs. |
||
63 | */ |
||
64 | public function connect() { |
||
73 | |||
74 | /** |
||
75 | * Deletes a file on the SFTP server. |
||
76 | * |
||
77 | * @param string $path The file to delete. |
||
78 | * @return SFTPClient Returns this SFTP client. |
||
79 | * @throws FTPException Throws a FTP exception if an I/O error occurs. |
||
80 | */ |
||
81 | public function delete($path) { |
||
87 | |||
88 | /** |
||
89 | * Get the SFTP resource. |
||
90 | * |
||
91 | * @return mixed Returns the SFTP resource. |
||
92 | */ |
||
93 | private function getSFTP() { |
||
99 | |||
100 | /** |
||
101 | * Logs in to this SFTP connection. |
||
102 | * |
||
103 | * @return SFTPClient Returns this SFTP client. |
||
104 | * @throws FTPException Throws a FTP exception if an I/O error occurs. |
||
105 | */ |
||
106 | public function login() { |
||
114 | |||
115 | /** |
||
116 | * Creates a directory. |
||
117 | * |
||
118 | * @param string $directory The directory. |
||
119 | * @param integer $mode The mode. |
||
120 | * @param boolean $recursive Recursively ?. |
||
121 | * @return SFTPClient Returns this SFTP client. |
||
122 | * @throws FTPException Throws a FTP exception if an I/O error occurs. |
||
123 | */ |
||
124 | public function mkdir($directory, $mode = 0777, $recursive = false) { |
||
130 | |||
131 | /** |
||
132 | * Uploads a file to the SFTP server. |
||
133 | * |
||
134 | * @param string $localFile The local file. |
||
135 | * @param string $remoteFile The remote file. |
||
136 | * @return SFTPClient Returns this SFTP client. |
||
137 | * @throws FTPException Throws a FTP exception if an I/O error occurs. |
||
138 | */ |
||
139 | public function put($localFile, $remoteFile) { |
||
145 | |||
146 | /** |
||
147 | * Renames a file or a directory on the SFTP server. |
||
148 | * |
||
149 | * @param string $oldName The old file/directory name. |
||
150 | * @param string $newName The new name. |
||
151 | * @return SFTPClient Returns this SFTP client. |
||
152 | * @throws FTPException Throws a FTP exception if an I/O error occurs. |
||
153 | */ |
||
154 | public function rename($oldName, $newName) { |
||
160 | |||
161 | /** |
||
162 | * Removes a directory. |
||
163 | * |
||
164 | * @param string $directory The directory. |
||
165 | * @return SFTPClient Returns this SFTP client. |
||
166 | * @throws FTPException Throws a FTP exception if an I/O error occurs. |
||
167 | */ |
||
168 | public function rmdir($directory) { |
||
174 | |||
175 | } |
||
176 |