From ef8b25cb13456b24d17e4e3ad9ed7ce28e15ad1e Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 19 Feb 2006 14:17:12 +0000 Subject: - Uploading changed language files in the language ACP panel :-) git-svn-id: file:///svn/phpbb/trunk@5562 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_transfer.php | 44 ++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_transfer.php') 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 @@ -178,6 +178,18 @@ class transfer return $this->_rmdir($dir); } + /** + * 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 */ @@ -228,9 +240,21 @@ 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 */ @@ -278,6 +302,14 @@ class ftp extends transfer return @ftp_rmdir($this->connection, $dir); } + /** + * Remove directory (RMDIR) + */ + function _rename($old_handle, $new_handle) + { + return @ftp_rename($this->connection, $old_handle, $new_handle); + } + /** * Change current working directory (CHDIR) */ @@ -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; } -- cgit v1.2.1