\Pop\FtpFtp

FTP class

Summary

Methods
Properties
Constants
__construct()
pwd()
chdir()
mkdir()
mkdirs()
rmdir()
fileExists()
dirExists()
get()
put()
rename()
chmod()
delete()
pasv()
isConnected()
getConnection()
getConnectionString()
disconnect()
No public properties found
No constants found
No protected methods found
$connection
$address
$username
$password
$connectionString
N/A
No private methods found
No private properties found
N/A

Properties

$connection

$connection : resource

FTP resource

Type

resource

$address

$address : string

FTP address

Type

string

$username

$username : string

FTP username

Type

string

$password

$password : string

FTP password

Type

string

$connectionString

$connectionString : string

FTP connection string

Type

string

Methods

__construct()

__construct(string  $address, string  $user, string  $pass, boolean  $ssl = false) 

Constructor

Instantiate the FTP object

Parameters

string $address
string $user
string $pass
boolean $ssl

Throws

\Pop\Ftp\Exception

pwd()

pwd() : string

Return current working directory

Returns

string

chdir()

chdir(string  $dir) : \Pop\Ftp\Ftp

Change directories

Parameters

string $dir

Throws

\Pop\Ftp\Exception

Returns

\Pop\Ftp\Ftp

mkdir()

mkdir(string  $dir) : \Pop\Ftp\Ftp

Make directory

Parameters

string $dir

Throws

\Pop\Ftp\Exception

Returns

\Pop\Ftp\Ftp

mkdirs()

mkdirs(string  $dirs) : \Pop\Ftp\Ftp

Make nested sub-directories

Parameters

string $dirs

Returns

\Pop\Ftp\Ftp

rmdir()

rmdir(string  $dir) : \Pop\Ftp\Ftp

Remove directory

Parameters

string $dir

Throws

\Pop\Ftp\Exception

Returns

\Pop\Ftp\Ftp

fileExists()

fileExists(string  $file) : boolean

Check if file exists

Parameters

string $file

Returns

boolean

dirExists()

dirExists(string  $dir) : boolean

Check if directory exists

Parameters

string $dir

Returns

boolean

get()

get(string  $local, string  $remote, integer|string  $mode = FTP_BINARY) : \Pop\Ftp\Ftp

Get file

Parameters

string $local
string $remote
integer|string $mode

Throws

\Pop\Ftp\Exception

Returns

\Pop\Ftp\Ftp

put()

put(string  $remote, string  $local, integer|string  $mode = FTP_BINARY) : \Pop\Ftp\Ftp

Put file

Parameters

string $remote
string $local
integer|string $mode

Throws

\Pop\Ftp\Exception

Returns

\Pop\Ftp\Ftp

rename()

rename(string  $old, string  $new) : \Pop\Ftp\Ftp

Rename file

Parameters

string $old
string $new

Throws

\Pop\Ftp\Exception

Returns

\Pop\Ftp\Ftp

chmod()

chmod(string  $file, string  $mode) : \Pop\Ftp\Ftp

Change permissions

Parameters

string $file
string $mode

Throws

\Pop\Ftp\Exception

Returns

\Pop\Ftp\Ftp

delete()

delete(string  $file) : \Pop\Ftp\Ftp

Delete file

Parameters

string $file

Throws

\Pop\Ftp\Exception

Returns

\Pop\Ftp\Ftp

pasv()

pasv(boolean  $flag = true) : \Pop\Ftp\Ftp

Switch the passive mode

Parameters

boolean $flag

Returns

\Pop\Ftp\Ftp

isConnected()

isConnected() : boolean

Determine whether or not connected

Returns

boolean

getConnection()

getConnection() : resource

Get the connection resource

Returns

resource

getConnectionString()

getConnectionString() : string

Get the connection string

Returns

string

disconnect()

disconnect() : void

Close the FTP connection.