| @@ 233-253 (lines=21) @@ | ||
| 230 | * @param bool $suppress_debug |
|
| 231 | * @return bool |
|
| 232 | */ |
|
| 233 | public function changedir($path, $suppress_debug = FALSE) |
|
| 234 | { |
|
| 235 | if ( ! $this->_is_conn()) |
|
| 236 | { |
|
| 237 | return FALSE; |
|
| 238 | } |
|
| 239 | ||
| 240 | $result = @ftp_chdir($this->conn_id, $path); |
|
| 241 | ||
| 242 | if ($result === FALSE) |
|
| 243 | { |
|
| 244 | if ($this->debug === TRUE && $suppress_debug === FALSE) |
|
| 245 | { |
|
| 246 | $this->_error('ftp_unable_to_changedir'); |
|
| 247 | } |
|
| 248 | ||
| 249 | return FALSE; |
|
| 250 | } |
|
| 251 | ||
| 252 | return TRUE; |
|
| 253 | } |
|
| 254 | ||
| 255 | // -------------------------------------------------------------------- |
|
| 256 | ||
| @@ 399-419 (lines=21) @@ | ||
| 396 | * @param bool $move |
|
| 397 | * @return bool |
|
| 398 | */ |
|
| 399 | public function rename($old_file, $new_file, $move = FALSE) |
|
| 400 | { |
|
| 401 | if ( ! $this->_is_conn()) |
|
| 402 | { |
|
| 403 | return FALSE; |
|
| 404 | } |
|
| 405 | ||
| 406 | $result = @ftp_rename($this->conn_id, $old_file, $new_file); |
|
| 407 | ||
| 408 | if ($result === FALSE) |
|
| 409 | { |
|
| 410 | if ($this->debug === TRUE) |
|
| 411 | { |
|
| 412 | $this->_error('ftp_unable_to_'.($move === FALSE ? 'rename' : 'move')); |
|
| 413 | } |
|
| 414 | ||
| 415 | return FALSE; |
|
| 416 | } |
|
| 417 | ||
| 418 | return TRUE; |
|
| 419 | } |
|
| 420 | ||
| 421 | // -------------------------------------------------------------------- |
|
| 422 | ||