diff options
author | David M <davidmj@users.sourceforge.net> | 2006-02-19 14:17:12 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-02-19 14:17:12 +0000 |
commit | ef8b25cb13456b24d17e4e3ad9ed7ce28e15ad1e (patch) | |
tree | e4bd5b6f465067f1159a98efb916e44011cedb26 /phpBB/includes/functions_transfer.php | |
parent | 26a6d215d0897afa82eea9b0cc0fca79d4544da5 (diff) | |
download | forums-ef8b25cb13456b24d17e4e3ad9ed7ce28e15ad1e.tar forums-ef8b25cb13456b24d17e4e3ad9ed7ce28e15ad1e.tar.gz forums-ef8b25cb13456b24d17e4e3ad9ed7ce28e15ad1e.tar.bz2 forums-ef8b25cb13456b24d17e4e3ad9ed7ce28e15ad1e.tar.xz forums-ef8b25cb13456b24d17e4e3ad9ed7ce28e15ad1e.zip |
- Uploading changed language files in the language ACP panel :-)
git-svn-id: file:///svn/phpbb/trunk@5562 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_transfer.php')
-rw-r--r-- | phpBB/includes/functions_transfer.php | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index a7e3277196..dca6391e4e 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -179,6 +179,18 @@ class transfer } /** + * Rename a file or folder + */ + function rename($old_handle, $new_handle) + { + global $phpbb_root_path; + + $old_handle = $this->root_path . '/' . str_replace($phpbb_root_path, '', $old_handle); + + return $this->_rename($old_handle, $new_handle); + } + + /** * Open session */ function open_session() @@ -228,10 +240,22 @@ class ftp extends transfer $this->timeout = $timeout; $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . ((substr($root_path, -1, 1) == '/') ? substr($root_path, 0, -1) : $root_path); + // Init some needed values + transfer::transfer(); + return; } /** + * Requests data + */ + function data() + { + global $config; + return array('host' => 'localhost' , 'username' => 'anonymous', 'password' => '', 'root_path' => $config['script_path'], 'port' => 21, 'timeout' => 10); + } + + /** * Init FTP Session */ function _init() @@ -279,6 +303,14 @@ class ftp extends transfer } /** + * Remove directory (RMDIR) + */ + function _rename($old_handle, $new_handle) + { + return @ftp_rename($this->connection, $old_handle, $new_handle); + } + + /** * Change current working directory (CHDIR) */ function _chdir($dir = '') @@ -296,9 +328,15 @@ class ftp extends transfer */ function _chmod($file, $perms) { - $chmod_cmd = 'CHMOD 0' . $perms . ' ' . $file; - $err = $this->_site($chmod_cmd); - + if (function_exists('ftp_chmod')) + { + $err = @ftp_chmod($this->connection, $perms, $file); + } + else + { + $chmod_cmd = 'CHMOD 0' . $perms . ' ' . $file; + $err = $this->_site($chmod_cmd); + } return $err; } |