JClientFtp::getInstance
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.
Signature
public function getInstance([string
$host = '127.0.0.1',
[string
$port = '21',
[array
$options = null,
[string
$user = null,
[string
$pass = null]]]]] )
Parameters
-
$host
- Host to connect to
-
$port
- Port to connect to
-
$options
- Array with any of these options: type=>[FTP_AUTOASCII|FTP_ASCII|FTP_BINARY], timeout=>(int)
-
$user
- Username to use for a connection
-
$pass
- Password to use for a connection
Returns
- JClientFtp
- The FTP Client object.