__construct()
__destruct()
change_dir()
chmod()
close()
connect()
delete_dir()
delete_file()
download()
forge()
list_files()
mirror()
mkdir()
move()
rename()
upload()
_is_conn()
_login()
_settype()
$initialized
$_conn_id
$_debug
$_hostname
$_passive
$_password
$_port
$_timeout
$_username
FTP Class
package | Fuel |
---|---|
category | Core |
author | Phil Sturgeon |
link | http://docs.fuelphp.com/classes/ftp.html |
__construct(string | array $config)
string
array
The name of the config group to use, or a configuration array.
__destruct() : void
change_dir(string $path) : bool
The second parameter lets us momentarily turn off debugging so that this function can be used to test for the existence of a folder without throwing an error. There's no FTP equivalent to is_dir() so we do it by trying to change to a particular directory. Internally, this parameter is only used by the "mirror" function below.
string
\FtpFileAccessException |
---|
bool
chmod(string $path, string $permissions) : bool
string
the file path
string
the permissions
\FtpFileAccessException |
---|
bool
close() : void
connect() : \Ftp
\FtpConnectionException |
---|
\Ftp
delete_dir(string $filepath) : bool
string
\FtpFileAccessException |
---|
bool
delete_file(string $filepath) : bool
string
\FtpFileAccessException |
---|
bool
download(string $remote_path, string $local_path, string $mode) : bool
string
string
string
\FtpFileAccessException |
---|
bool
forge(string | array $config, bool $connect) : \Fuel\Core\Ftp
If you do not define the "file" parameter,
$ftp = static::forge('group');
string
array
The name of the config group to use, or a configuration array.
bool
Automatically connect to this server.
list_files(string $path) : array
string
array
mirror(string $local_path, string $remote_path) : bool
This function recursively reads a folder and everything it contains (including sub-folders) and creates a mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server.
string
path to source with trailing slash
string
path to destination - include the base folder with trailing slash
bool
mkdir(string $path, string $permissions) : bool
string
string
\FtpFileAccessException |
---|
bool
move(string $old_file, string $new_file) : bool
string
string
bool
rename(\Fuel\Core\$old_file $old_file, \Fuel\Core\$new_file $new_file, \Fuel\Core\$move $move) : bool
\Fuel\Core\$old_file
string
\Fuel\Core\$new_file
string
\Fuel\Core\$move
bool
\FtpFileAccessException |
---|
bool
upload(string $local_path, string $remote_path, string $mode, string $permissions) : bool
string
string
string
string
\FtpFileAccessException |
---|
bool
_is_conn() : bool
bool
_login() : bool
bool
_settype(string $ext) : string
string
string
$initialized
$_conn_id
$_debug
$_hostname
$_passive
$_password
$_port
$_timeout
$_username