__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)
stringarrayThe 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 |
|---|
boolchmod(string $path, string $permissions) : bool
stringthe file path
stringthe permissions
\FtpFileAccessException |
|---|
boolclose() : void
connect() : \Ftp
\FtpConnectionException |
|---|
\Ftpdelete_dir(string $filepath) : bool
string
\FtpFileAccessException |
|---|
booldelete_file(string $filepath) : bool
string
\FtpFileAccessException |
|---|
booldownload(string $remote_path, string $local_path, string $mode) : bool
string
string
string
\FtpFileAccessException |
|---|
boolforge(string | array $config, bool $connect) : \Fuel\Core\Ftp
If you do not define the "file" parameter,
$ftp = static::forge('group');
stringarrayThe name of the config group to use, or a configuration array.
boolAutomatically connect to this server.
list_files(string $path) : array
string
arraymirror(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.
stringpath to source with trailing slash
stringpath to destination - include the base folder with trailing slash
boolmkdir(string $path, string $permissions) : bool
string
string
\FtpFileAccessException |
|---|
boolmove(string $old_file, string $new_file) : bool
string
string
boolrename(\Fuel\Core\$old_file $old_file, \Fuel\Core\$new_file $new_file, \Fuel\Core\$move $move) : bool
\Fuel\Core\$old_filestring
\Fuel\Core\$new_filestring
\Fuel\Core\$movebool
\FtpFileAccessException |
|---|
boolupload(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