Joomla CMS
3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
|
Fonctions membres publiques | |
__construct (array $options=array()) | |
__destruct () | |
setOptions (array $options) | |
connect ($host='127.0.0.1', $port=21) | |
isConnected () | |
login ($user='anonymous', $pass='jftp @joomla.org') | |
quit () | |
pwd () | |
syst () | |
chdir ($path) | |
reinit () | |
rename ($from, $to) | |
chmod ($path, $mode) | |
delete ($path) | |
mkdir ($path) | |
restart ($point) | |
create ($path) | |
read ($remote, &$buffer) | |
get ($local, $remote) | |
store ($local, $remote=null) | |
write ($remote, $buffer) | |
append ($remote, $buffer) | |
size ($remote) | |
listNames ($path=null) | |
listDetails ($path=null, $type='all') | |
Fonctions membres publiques statiques | |
static | getInstance ($host='127.0.0.1', $port='21', array $options=array(), $user=null, $pass=null) |
Fonctions membres protégées | |
_putCmd ($cmd, $expectedResponse) | |
_verifyResponse ($expected) | |
_passive () | |
_findMode ($fileName) | |
_mode ($mode) | |
Attributs protégés | |
$_conn = null | |
$_dataconn = null | |
$_pasv = null | |
$_response = null | |
$_timeout = 15 | |
$_type = null | |
$_autoAscii | |
$_lineEndings = array('UNIX' => "\n", 'WIN' => "\r\n") | |
Attributs protégés statiques | |
static | $instances = array() |
FTP client class
__construct | ( | array | $options = array() | ) |
FtpClient object constructor
array | $options | Associative array of options to set |
Références $options, FtpClient\setOptions(), et BufferStreamHandler\stream_register().
__destruct | ( | ) |
FtpClient object destructor
Closes an existing connection, if we have one
Références FtpClient\quit().
|
protected |
Method to find out the correct transfer mode for a specific file
string | $fileName | Name of the file |
Référencé par FtpClient\append(), FtpClient\get(), FtpClient\read(), FtpClient\store(), et FtpClient\write().
|
protected |
Set transfer mode
integer | $mode | Integer representation of data transfer mode [1:Binary|0:Ascii] Defined constants can also be used [FTP_BINARY|FTP_ASCII] |
Références $mode, FtpClient\_putCmd(), Log\add(), et Log\WARNING.
Référencé par FtpClient\append(), FtpClient\get(), FtpClient\read(), FtpClient\store(), et FtpClient\write().
|
protected |
Set server to passive mode and open a data port connection
Références FtpClient\$_timeout, $parts, Log\add(), null, et Log\WARNING.
Référencé par FtpClient\append(), FtpClient\create(), FtpClient\get(), FtpClient\listDetails(), FtpClient\listNames(), FtpClient\read(), FtpClient\size(), FtpClient\store(), et FtpClient\write().
|
protected |
Send command to the FTP server and validate an expected response code
string | $cmd | Command to send to the FTP server |
mixed | $expectedResponse | Integer response code or array of integer response codes |
Références FtpClient\_verifyResponse(), Log\add(), et Log\WARNING.
Référencé par FtpClient\_mode(), FtpClient\append(), FtpClient\chdir(), FtpClient\chmod(), FtpClient\create(), FtpClient\delete(), FtpClient\get(), FtpClient\listDetails(), FtpClient\listNames(), FtpClient\login(), FtpClient\mkdir(), FtpClient\pwd(), FtpClient\read(), FtpClient\reinit(), FtpClient\rename(), FtpClient\restart(), FtpClient\size(), FtpClient\store(), FtpClient\syst(), et FtpClient\write().
|
protected |
Verify the response code from the server and log response if flag is set
mixed | $expected | Integer response code or array of integer response codes |
Références FtpClient\$_timeout, $parts, Log\add(), null, et Log\WARNING.
Référencé par FtpClient\_putCmd(), FtpClient\append(), FtpClient\connect(), FtpClient\create(), FtpClient\get(), FtpClient\listDetails(), FtpClient\listNames(), FtpClient\read(), FtpClient\store(), et FtpClient\write().
append | ( | $remote, | |
$buffer | |||
) |
Method to append a string to the FTP server
string | $remote | FTP path to file to append to |
string | $buffer | Contents to append to the FTP server |
Références $buffer, $mode, $tmp, FtpClient\_findMode(), FtpClient\_mode(), FtpClient\_passive(), FtpClient\_putCmd(), FtpClient\_verifyResponse(), et FtpClient\size().
chdir | ( | $path | ) |
Method to change the current working directory on the FTP server
string | $path | Path to change into on the server |
Références $path, FtpClient\_putCmd(), Log\add(), et Log\WARNING.
chmod | ( | $path, | |
$mode | |||
) |
Method to change mode for a path on the FTP server
string | $path | Path to change mode on |
mixed | $mode | Octal value to change mode to, e.g. '0777', 0777 or 511 (string or integer) |
Références $mode, $path, FtpClient\_putCmd(), Log\add(), et Log\WARNING.
connect | ( | $host = '127.0.0.1' , |
|
$port = 21 |
|||
) |
Method to connect to a FTP server
string | $host | Host to connect to [Default: 127.0.0.1] |
string | $port | Port to connect on [Default: port 21] |
Références FtpClient\_verifyResponse(), Log\add(), null, et Log\WARNING.
create | ( | $path | ) |
Method to create an empty file on the FTP server
string | $path | Path local file to store on the FTP server |
Références $buffer, $path, FtpClient\_passive(), FtpClient\_putCmd(), FtpClient\_verifyResponse(), Log\add(), et Log\WARNING.
delete | ( | $path | ) |
Method to delete a path [file/folder] on the FTP server
string | $path | Path to delete |
Références $path, FtpClient\_putCmd(), Log\add(), et Log\WARNING.
get | ( | $local, | |
$remote | |||
) |
Method to get a file from the FTP server and save it to a local file
string | $local | Local path to save remote file to |
string | $remote | Path to remote file to get on the FTP server |
Références $buffer, $mode, FtpClient\_findMode(), FtpClient\_mode(), FtpClient\_passive(), FtpClient\_putCmd(), FtpClient\_verifyResponse(), Log\add(), et Log\WARNING.
|
static |
Returns the global FTP connector object, only creating it if it doesn't already exist.
You may optionally specify a username and password in the parameters. If you do so, you may not login() again with different credentials using the same object. If you do not use this option, you must quit() the current connection when you are done, to free it for use by others.
string | $host | Host to connect to |
string | $port | Port to connect to |
array | $options | Array with any of these options: type=>[FTP_AUTOASCII|FTP_ASCII|FTP_BINARY], timeout=>(int) |
string | $user | Username to use for a connection |
string | $pass | Password to use for a connection |
Références $options, $return, $user, FtpClient\isConnected(), et null.
Référencé par File\append(), Folder\copy(), File\copy(), Folder\create(), File\delete(), Folder\delete(), File\move(), Folder\move(), ClientHelper\setCredentials(), File\upload(), et File\write().
isConnected | ( | ) |
Method to determine if the object is connected to an FTP server
Référencé par FtpClient\getInstance().
listDetails | ( | $path = null , |
|
$type = 'all' |
|||
) |
Method to list the contents of a directory on the FTP server
string | $path | Path to the local file to be stored on the FTP server |
string | $type | Return type [raw|all|folders|files] |
Références $data, $file, $path, $type, FtpClient\_passive(), FtpClient\_putCmd(), FtpClient\_verifyResponse(), Log\add(), null, et Log\WARNING.
Référencé par FtpClient\listNames().
listNames | ( | $path = null | ) |
Method to list the filenames of the contents of a directory on the FTP server
Note: Some servers also return folder names. However, to be sure to list folders on all servers, you should use listDetails() instead if you also need to deal with folders
string | $path | Path local file to store on the FTP server |
Références $data, $key, $list, $path, FtpClient\_passive(), FtpClient\_putCmd(), FtpClient\_verifyResponse(), Log\add(), FtpClient\listDetails(), null, et Log\WARNING.
login | ( | $user = 'anonymous' , |
|
$pass = 'jftp@joomla.org' |
|||
) |
Method to login to a server once connected
string | $user | Username to login to the server |
string | $pass | Password to login to the server |
Références $user, FtpClient\_putCmd(), Log\add(), et Log\WARNING.
mkdir | ( | $path | ) |
Method to create a directory on the FTP server
string | $path | Directory to create |
Références $path, FtpClient\_putCmd(), Log\add(), et Log\WARNING.
pwd | ( | ) |
Method to retrieve the current working directory on the FTP server
Références FtpClient\_putCmd(), Log\add(), null, et Log\WARNING.
quit | ( | ) |
Method to quit and close the connection
Référencé par FtpClient\__destruct().
read | ( | $remote, | |
& | $buffer | ||
) |
Method to read a file from the FTP server's contents into a buffer
string | $remote | Path to remote file to read on the FTP server |
string | &$buffer | Buffer variable to read file contents into |
Références $buffer, $mode, $os, $tmp, FtpClient\_findMode(), FtpClient\_mode(), FtpClient\_passive(), FtpClient\_putCmd(), FtpClient\_verifyResponse(), Log\add(), et Log\WARNING.
reinit | ( | ) |
Method to reinitialise the server, ie. need to login again
NOTE: This command not available on all servers
Références FtpClient\_putCmd(), Log\add(), et Log\WARNING.
rename | ( | $from, | |
$to | |||
) |
Method to rename a file/folder on the FTP server
string | $from | Path to change file/folder from |
string | $to | Path to change file/folder to |
Références FtpClient\_putCmd(), Log\add(), et Log\WARNING.
restart | ( | $point | ) |
Method to restart data transfer at a given byte
integer | $point | Byte to restart transfer at |
Références FtpClient\_putCmd(), Log\add(), et Log\WARNING.
setOptions | ( | array | $options | ) |
Set client options
array | $options | Associative array of options to set |
Références $options.
Référencé par FtpClient\__construct().
size | ( | $remote | ) |
Get the size of the remote file.
string | $remote | FTP path to file whose size to get |
Références FtpClient\_passive(), et FtpClient\_putCmd().
Référencé par FtpClient\append().
store | ( | $local, | |
$remote = null |
|||
) |
Method to store a file to the FTP server
string | $local | Path to local file to store on the FTP server |
string | $remote | FTP path to file to create |
Références $mode, FtpClient\_findMode(), FtpClient\_mode(), FtpClient\_passive(), FtpClient\_putCmd(), FtpClient\_verifyResponse(), Log\add(), null, et Log\WARNING.
syst | ( | ) |
Method to system string from the FTP server
Références FtpClient\$_response, FtpClient\_putCmd(), Log\add(), elseif, et Log\WARNING.
write | ( | $remote, | |
$buffer | |||
) |
Method to write a string to the FTP server
string | $remote | FTP path to file to write to |
string | $buffer | Contents to write to the FTP server |
Références $buffer, $mode, $tmp, FtpClient\_findMode(), FtpClient\_mode(), FtpClient\_passive(), FtpClient\_putCmd(), FtpClient\_verifyResponse(), Log\add(), et Log\WARNING.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Référencé par FtpClient\syst().
|
protected |
Référencé par FtpClient\_passive(), et FtpClient\_verifyResponse().
|
protected |
|
staticprotected |