|
static | getInstance ($host='127.0.0.1', $port='21', array $options=array(), $user=null, $pass=null) |
|
FTP client class
- Depuis
- 1.0
◆ __construct()
__construct |
( |
array |
$options = array() | ) |
|
◆ __destruct()
◆ _findMode()
◆ _mode()
◆ _passive()
◆ _putCmd()
_putCmd |
( |
|
$cmd, |
|
|
|
$expectedResponse |
|
) |
| |
|
protected |
Send command to the FTP server and validate an expected response code
- Paramètres
-
string | $cmd | Command to send to the FTP server |
mixed | $expectedResponse | Integer response code or array of integer response codes |
- Renvoie
- boolean True if command executed successfully
- Depuis
- 1.0
- Exceptions
-
Références FtpClient\_verifyResponse().
Référencé par FtpClient\_mode(), 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\store(), FtpClient\syst(), et FtpClient\write().
◆ _verifyResponse()
_verifyResponse |
( |
|
$expected | ) |
|
|
protected |
Verify the response code from the server and log response if flag is set
- Paramètres
-
mixed | $expected | Integer response code or array of integer response codes |
- Renvoie
- boolean True if response code from the server is expected
- Depuis
- 1.0
- Exceptions
-
Références $parts, FtpClient\$timeout, et null.
Référencé par FtpClient\_putCmd(), FtpClient\connect(), FtpClient\create(), FtpClient\get(), FtpClient\listDetails(), FtpClient\listNames(), FtpClient\read(), FtpClient\store(), et FtpClient\write().
◆ chdir()
Method to change the current working directory on the FTP server
- Paramètres
-
string | $path | Path to change into on the server |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références $path, et FtpClient\_putCmd().
◆ chmod()
Method to change mode for a path on the FTP server
- Paramètres
-
string | $path | Path to change mode on |
mixed | $mode | Octal value to change mode to, e.g. '0777', 0777 or 511 (string or integer) |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références $mode, $path, et FtpClient\_putCmd().
◆ connect()
connect |
( |
|
$host = '127.0.0.1' , |
|
|
|
$port = 21 |
|
) |
| |
Method to connect to a FTP server
- Paramètres
-
string | $host | Host to connect to [Default: 127.0.0.1] |
integer | $port | Port to connect on [Default: port 21] |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références FtpClient\_verifyResponse(), et null.
◆ create()
◆ delete()
Method to delete a path [file/folder] on the FTP server
- Paramètres
-
string | $path | Path to delete |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références $path, et FtpClient\_putCmd().
◆ get()
◆ getInstance()
static getInstance |
( |
|
$host = '127.0.0.1' , |
|
|
|
$port = '21' , |
|
|
array |
$options = array() , |
|
|
|
$user = null , |
|
|
|
$pass = null |
|
) |
| |
|
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.
- Paramètres
-
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 |
- Renvoie
- FtpClient The FTP Client object.
- Depuis
- 1.0
Références $options, $return, $user, FtpClient\isConnected(), et null.
◆ isConnected()
Method to determine if the object is connected to an FTP server
- Renvoie
- boolean True if connected
- Depuis
- 1.0
Référencé par FtpClient\getInstance().
◆ listDetails()
listDetails |
( |
|
$path = null , |
|
|
|
$type = 'all' |
|
) |
| |
◆ 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
- Paramètres
-
string | $path | Path local file to store on the FTP server |
- Renvoie
- string Directory listing
- Depuis
- 1.0
- Exceptions
-
Références $data, $key, $list, $path, FtpClient\_passive(), FtpClient\_putCmd(), FtpClient\_verifyResponse(), FtpClient\listDetails(), et null.
◆ login()
login |
( |
|
$user = 'anonymous' , |
|
|
|
$pass = 'jftp@joomla.org' |
|
) |
| |
Method to login to a server once connected
- Paramètres
-
string | $user | Username to login to the server |
string | $pass | Password to login to the server |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références $user, et FtpClient\_putCmd().
◆ mkdir()
Method to create a directory on the FTP server
- Paramètres
-
string | $path | Directory to create |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références $path, et FtpClient\_putCmd().
◆ pwd()
Method to retrieve the current working directory on the FTP server
- Renvoie
- string Current working directory
- Depuis
- 1.0
- Exceptions
-
Références FtpClient\_putCmd(), et null.
◆ quit()
Method to quit and close the connection
- Renvoie
- boolean True if successful
- Depuis
- 1.0
Référencé par FtpClient\__destruct().
◆ read()
read |
( |
|
$remote, |
|
|
& |
$buffer |
|
) |
| |
◆ reinit()
Method to reinitialise the server, ie. need to login again
NOTE: This command not available on all servers
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références FtpClient\_putCmd().
◆ rename()
Method to rename a file/folder on the FTP server
- Paramètres
-
string | $from | Path to change file/folder from |
string | $to | Path to change file/folder to |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références FtpClient\_putCmd().
◆ restart()
Method to restart data transfer at a given byte
- Paramètres
-
integer | $point | Byte to restart transfer at |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références FtpClient\_putCmd().
◆ setOptions()
setOptions |
( |
array |
$options | ) |
|
Set client options
- Paramètres
-
array | $options | Associative array of options to set |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
Références $options.
Référencé par FtpClient\__construct().
◆ store()
store |
( |
|
$local, |
|
|
|
$remote = null |
|
) |
| |
◆ syst()
◆ write()
write |
( |
|
$remote, |
|
|
|
$buffer |
|
) |
| |
◆ $autoAscii
Valeur initiale := array(
'asp',
'bat',
'c',
'cpp',
'csv',
'h',
'htm',
'html',
'shtml',
'ini',
'inc',
'log',
'php',
'php3',
'pl',
'perl',
'sh',
'sql',
'txt',
'xhtml',
'xml',
)
◆ $conn
◆ $dataconn
◆ $instances
◆ $lineEndings
$lineEndings = array('UNIX' => "\n", 'WIN' => "\r\n") |
|
private |
◆ $pasv
◆ $response
◆ $responseCode
◆ $responseMsg
◆ $timeout
◆ $type
La documentation de cette classe a été générée à partir du fichier suivant :