FTP
Table of Contents
- $connection : resource
- Connection.
- $connectionString : resource
- connectionString.
- __construct() : mixed
- Instantiate the FTP object.
- chdir() : bool
- Change directories.
- chmod() : bool
- Change permission.
- delete() : bool
- Delete the files.
- dirExists() : bool
- Check is the dir is exists.
- disconnect() : void
- Close the FTP connection.
- fileExists() : bool
- Check if file exists.
- ftpFiles() : mixed
- get the list of files.
- get() : bool
- Get the file.
- getConnection() : resource
- get the connection.
- isConnected() : bool
- check whether the ftp is connected.
- mkdir() : bool
- Make directory.
- mkdirs() : object
- Make nested sub-directories.
- pasv() : bool
- Switch the passive mod.
- put() : mixed
- Upload the files.
- pwd() : mixed
- get the current working directory.
- rename() : bool
- Rename file.
- rmdir() : bool
- Remove directory.
Properties
$connection
Connection.
private
resource
$connection
Tags
$connectionString
connectionString.
private
resource
$connectionString
Tags
Methods
__construct()
Instantiate the FTP object.
public
__construct((string) $host, (string) $user, (string) $pass, (string) $secured) : mixed
Parameters
- $host : (string)
-
server host
- $user : (string)
-
username
- $pass : (string)
-
password
- $secured : (string)
-
ftp or sftp
Tags
Return values
mixed —chdir()
Change directories.
public
chdir((string) $dir) : bool
Parameters
- $dir : (string)
-
directory
Tags
Return values
bool —chmod()
Change permission.
public
chmod((string) $file, (mixed) $mode) : bool
Parameters
- $file : (string)
-
file
- $mode : (mixed)
-
mode
Tags
Return values
bool —delete()
Delete the files.
public
delete((string) $file) : bool
Parameters
- $file : (string)
-
file you want to delete
Tags
Return values
bool —dirExists()
Check is the dir is exists.
public
dirExists((string) $dir) : bool
Parameters
- $dir : (string)
-
directory
Tags
Return values
bool —disconnect()
Close the FTP connection.
public
disconnect() : void
Tags
Return values
void —fileExists()
Check if file exists.
public
fileExists((string) $file) : bool
Parameters
- $file : (string)
Tags
Return values
bool —ftpFiles()
get the list of files.
public
ftpFiles((string) $dir) : mixed
Parameters
- $dir : (string)
-
directory
Tags
Return values
mixed —get()
Get the file.
public
get((mixed) $local, (mixed) $remote[, (mixed) $mode = FTP_BINARY ]) : bool
Parameters
- $local : (mixed)
-
local
- $remote : (mixed)
-
remote
- $mode : (mixed) = FTP_BINARY
-
mode
Tags
Return values
bool —getConnection()
get the connection.
public
getConnection() : resource
Tags
Return values
resource —isConnected()
check whether the ftp is connected.
public
isConnected() : bool
Tags
Return values
bool —mkdir()
Make directory.
public
mkdir((string) $dir) : bool
Parameters
- $dir : (string)
-
directory name
Tags
Return values
bool —mkdirs()
Make nested sub-directories.
public
mkdirs((array) $dirs) : object
Parameters
- $dirs : (array)
Tags
Return values
object —pasv()
Switch the passive mod.
public
pasv([(bool) $flag = true ]) : bool
Parameters
- $flag : (bool) = true
-
flag
Tags
Return values
bool —put()
Upload the files.
public
put((array) $files[, (string) $root = 'public_html' ]) : mixed
Parameters
- $files : (array)
-
number of files you want to uplaod
- $root : (string) = 'public_html'
-
Server root directory or sub
Tags
Return values
mixed —pwd()
get the current working directory.
public
pwd() : mixed
Tags
Return values
mixed —rename()
Rename file.
public
rename((string) $old, (string) $new) : bool
Parameters
- $old : (string)
-
old
- $new : (string)
-
naw name
Tags
Return values
bool —rmdir()
Remove directory.
public
rmdir((string) $dir) : bool
Parameters
- $dir : (string)
-
directory