1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

- Uploading changed language files in the language ACP panel :-)

git-svn-id: file:///svn/phpbb/trunk@5562 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M
2006-02-19 14:17:12 +00:00
parent 26a6d215d0
commit ef8b25cb13
6 changed files with 228 additions and 17 deletions

View File

@@ -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;
}