| @@ 208-219 (lines=12) @@ | ||
| 205 | * |
|
| 206 | * @return bool |
|
| 207 | */ |
|
| 208 | public function delete($path) |
|
| 209 | { |
|
| 210 | $connection = $this->getConnection(); |
|
| 211 | ||
| 212 | $response = $this->rawCommand($connection, 'DELE ' . $path); |
|
| 213 | list($code, $message) = explode(' ', end($response), 2); |
|
| 214 | if ($code !== '250') { |
|
| 215 | return false; |
|
| 216 | } |
|
| 217 | ||
| 218 | return true; |
|
| 219 | } |
|
| 220 | ||
| 221 | /** |
|
| 222 | * Delete a directory. |
|
| @@ 228-239 (lines=12) @@ | ||
| 225 | * |
|
| 226 | * @return bool |
|
| 227 | */ |
|
| 228 | public function deleteDir($dirname) |
|
| 229 | { |
|
| 230 | $connection = $this->getConnection(); |
|
| 231 | ||
| 232 | $response = $this->rawCommand($connection, 'RMD ' . $dirname); |
|
| 233 | list($code, $message) = explode(' ', end($response), 2); |
|
| 234 | if ($code !== '250') { |
|
| 235 | return false; |
|
| 236 | } |
|
| 237 | ||
| 238 | return true; |
|
| 239 | } |
|
| 240 | ||
| 241 | /** |
|
| 242 | * Create a directory. |
|