Documentation

Ftp
in package

FTP class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
3.0.4

Table of Contents

$address  : string
FTP address
$connection  : resource
FTP resource
$connectionString  : string
FTP connection string
$password  : string
FTP password
$username  : string
FTP username
__construct()  : mixed
Constructor
chdir()  : Ftp
Change directories
chmod()  : Ftp
Change permissions
delete()  : Ftp
Delete file
dirExists()  : bool
Check if directory exists
disconnect()  : void
Close the FTP connection.
fileExists()  : bool
Check if file exists
get()  : Ftp
Get file
getConnection()  : resource
Get the connection resource
getConnectionString()  : string
Get the connection string
isConnected()  : bool
Determine whether or not connected
mkdir()  : Ftp
Make directory
mkdirs()  : Ftp
Make nested sub-directories
pasv()  : Ftp
Switch the passive mode
put()  : Ftp
Put file
pwd()  : string
Return current working directory
rename()  : Ftp
Rename file
rmdir()  : Ftp
Remove directory

Properties

$address

FTP address

protected string $address = null

$connection

FTP resource

protected resource $connection = null

$connectionString

FTP connection string

protected string $connectionString = null

$password

FTP password

protected string $password = null

$username

FTP username

protected string $username = null

Methods

__construct()

Constructor

public __construct(string $address, string $user, string $pass[, bool $ssl = false ]) : mixed

Instantiate the FTP object

Parameters
$address : string
$user : string
$pass : string
$ssl : bool = false
Tags
throws
Exception
Return values
mixed

chdir()

Change directories

public chdir(string $dir) : Ftp
Parameters
$dir : string
Tags
throws
Exception
Return values
Ftp

chmod()

Change permissions

public chmod(string $file, string $mode) : Ftp
Parameters
$file : string
$mode : string
Tags
throws
Exception
Return values
Ftp

delete()

Delete file

public delete(string $file) : Ftp
Parameters
$file : string
Tags
throws
Exception
Return values
Ftp

dirExists()

Check if directory exists

public dirExists(string $dir) : bool
Parameters
$dir : string
Return values
bool

disconnect()

Close the FTP connection.

public disconnect() : void
Return values
void

fileExists()

Check if file exists

public fileExists(string $file) : bool
Parameters
$file : string
Return values
bool

get()

Get file

public get(string $local, string $remote[, int|string $mode = FTP_BINARY ]) : Ftp
Parameters
$local : string
$remote : string
$mode : int|string = FTP_BINARY
Tags
throws
Exception
Return values
Ftp

getConnection()

Get the connection resource

public getConnection() : resource
Return values
resource

getConnectionString()

Get the connection string

public getConnectionString() : string
Return values
string

isConnected()

Determine whether or not connected

public isConnected() : bool
Return values
bool

mkdir()

Make directory

public mkdir(string $dir) : Ftp
Parameters
$dir : string
Tags
throws
Exception
Return values
Ftp

mkdirs()

Make nested sub-directories

public mkdirs(string $dirs) : Ftp
Parameters
$dirs : string
Return values
Ftp

pasv()

Switch the passive mode

public pasv([bool $flag = true ]) : Ftp
Parameters
$flag : bool = true
Return values
Ftp

put()

Put file

public put(string $remote, string $local[, int|string $mode = FTP_BINARY ]) : Ftp
Parameters
$remote : string
$local : string
$mode : int|string = FTP_BINARY
Tags
throws
Exception
Return values
Ftp

pwd()

Return current working directory

public pwd() : string
Return values
string

rename()

Rename file

public rename(string $old, string $new) : Ftp
Parameters
$old : string
$new : string
Tags
throws
Exception
Return values
Ftp

rmdir()

Remove directory

public rmdir(string $dir) : Ftp
Parameters
$dir : string
Tags
throws
Exception
Return values
Ftp

Search results