Line 281 | Line 281 |
---|
}
// Init some needed values
|
}
// Init some needed values
|
$this->transfer();
| parent::__construct();
|
return; }
| return; }
|
Line 341 | Line 341 |
---|
*/ function _mkdir($dir) {
|
*/ function _mkdir($dir) {
|
| if (!$this->connection) { return false; }
|
return @ftp_mkdir($this->connection, $dir); }
| return @ftp_mkdir($this->connection, $dir); }
|
Line 350 | Line 355 |
---|
*/ function _rmdir($dir) {
|
*/ function _rmdir($dir) {
|
| if (!$this->connection) { return false; }
|
return @ftp_rmdir($this->connection, $dir); }
| return @ftp_rmdir($this->connection, $dir); }
|
Line 359 | Line 369 |
---|
*/ function _rename($old_handle, $new_handle) {
|
*/ function _rename($old_handle, $new_handle) {
|
| if (!$this->connection) { return false; }
|
return @ftp_rename($this->connection, $old_handle, $new_handle); }
| return @ftp_rename($this->connection, $old_handle, $new_handle); }
|
Line 368 | Line 383 |
---|
*/ function _chdir($dir = '') {
|
*/ function _chdir($dir = '') {
|
| if (!$this->connection) { return false; }
|
if ($dir && $dir !== '/') { if (substr($dir, -1, 1) == '/')
| if ($dir && $dir !== '/') { if (substr($dir, -1, 1) == '/')
|
Line 385 | Line 405 |
---|
*/ function _chmod($file, $perms) {
|
*/ function _chmod($file, $perms) {
|
| if (!$this->connection) { return false; }
|
if (function_exists('ftp_chmod')) { $err = @ftp_chmod($this->connection, $perms, $file);
| if (function_exists('ftp_chmod')) { $err = @ftp_chmod($this->connection, $perms, $file);
|
Line 406 | Line 431 |
---|
*/ function _put($from_file, $to_file) {
|
*/ function _put($from_file, $to_file) {
|
| if (!$this->connection) { return false; }
|
// We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced) $mode = FTP_BINARY;
| // We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced) $mode = FTP_BINARY;
|
Line 425 | Line 455 |
---|
*/ function _delete($file) {
|
*/ function _delete($file) {
|
| if (!$this->connection) { return false; }
|
return @ftp_delete($this->connection, $file); }
| return @ftp_delete($this->connection, $file); }
|
Line 449 | Line 484 |
---|
*/ function _cwd() {
|
*/ function _cwd() {
|
| if (!$this->connection) { return false; }
|
return @ftp_pwd($this->connection); }
| return @ftp_pwd($this->connection); }
|
Line 458 | Line 498 |
---|
*/ function _ls($dir = './') {
|
*/ function _ls($dir = './') {
|
| if (!$this->connection) { return false; }
|
$list = @ftp_nlist($this->connection, $dir);
// See bug #46295 - Some FTP daemons don't like './'
| $list = @ftp_nlist($this->connection, $dir);
// See bug #46295 - Some FTP daemons don't like './'
|
Line 498 | Line 543 |
---|
*/ function _site($command) {
|
*/ function _site($command) {
|
| if (!$this->connection) { return false; }
|
return @ftp_site($this->connection, $command); } }
| return @ftp_site($this->connection, $command); } }
|
Line 782 | Line 832 |
---|
*/ function _send_command($command, $args = '', $check = true) {
|
*/ function _send_command($command, $args = '', $check = true) {
|
| if (!$this->connection) { return false; }
|
if (!empty($args)) { $command = "$command $args";
| if (!empty($args)) { $command = "$command $args";
|
Line 871 | Line 926 |
---|
*/ function _close_data_connection() {
|
*/ function _close_data_connection() {
|
| if (!$this->connection) { return false; }
|
return @fclose($this->data_connection); }
| return @fclose($this->data_connection); }
|
Line 880 | Line 940 |
---|
*/ function _check_command($return = false) {
|
*/ function _check_command($return = false) {
|
| if (!$this->connection) { return false; }
|
$response = '';
do
| $response = '';
do
|