API Joomla 1.5.26
Documentation des API du CMS Joomla en version 1.5
|
JFTP::__construct | ( | $ | options = array() | ) |
JFTP object constructor
protected
array | $options | Associative array of options to set |
Références elseif, jimport(), JLoader::load(), et setOptions().
JFTP::__destruct | ( | ) |
JFTP::_findMode | ( | $ | fileName | ) |
JFTP::_mode | ( | $ | mode | ) |
Set transfer mode
private
int | $mode | Integer representation of data transfer mode [1:Binary|0:Ascii] Defined constants can also be used [FTP_BINARY|FTP_ASCII] |
Références _putCmd(), et JError::raiseWarning().
Référencé par get(), read(), store(), et write().
JFTP::_passive | ( | ) |
Set server to passive mode and open a data port connection
private
Références $parts, et JError::raiseWarning().
Référencé par create(), get(), listDetails(), listNames(), read(), store(), et write().
JFTP::_putCmd | ( | $ | cmd, |
$ | expectedResponse | ||
) |
Send command to the FTP server and validate an expected response code
private
string | $cmd | Command to send to the FTP server |
mixed | $expected | Integer response code or array of integer response codes |
Références $cmd, _verifyResponse(), et JError::raiseWarning().
Référencé par _mode(), chdir(), chmod(), create(), delete(), get(), listDetails(), listNames(), login(), mkdir(), pwd(), read(), reinit(), rename(), restart(), store(), syst(), et write().
JFTP::_verifyResponse | ( | $ | expected | ) |
Verify the response code from the server and log response if flag is set
private
mixed | $expected | Integer response code or array of integer response codes |
Références $parts, et JError::raiseWarning().
Référencé par _putCmd(), connect(), create(), get(), listDetails(), listNames(), read(), store(), et write().
JFTP::chdir | ( | $ | path | ) |
Method to change the current working directory on the FTP server
public
string | $path | Path to change into on the server |
Références $path, _putCmd(), et JError::raiseWarning().
JFTP::chmod | ( | $ | path, |
$ | mode | ||
) |
Method to change mode for a path on the FTP server
public
string | $path | Path to change mode on |
string/int | $mode Octal value to change mode to, e.g. '0777', 0777 or 511 |
Références $path, _putCmd(), et JError::raiseWarning().
JFTP::connect | ( | $ | host = '127.0.0.1' , |
$ | port = 21 |
||
) |
Method to connect to a FTP server
public
string | $host | Host to connect to [Default: 127.0.0.1] |
string | $port | Port to connect on [Default: port 21] |
Références $host, _verifyResponse(), et JError::raiseWarning().
JFTP::create | ( | $ | path | ) |
Method to create an empty file on the FTP server
public
string | $path | Path local file to store on the FTP server |
Références $path, _passive(), _putCmd(), _verifyResponse(), et JError::raiseWarning().
JFTP::delete | ( | $ | path | ) |
Method to delete a path [file/folder] on the FTP server
public
string | $path | Path to delete |
Références $path, _putCmd(), et JError::raiseWarning().
JFTP::get | ( | $ | local, |
$ | remote | ||
) |
Method to get a file from the FTP server and save it to a local file
public
string | $local | Path to local file to save remote file as |
string | $remote | Path to remote file to get on the FTP server |
Réimplémentée à partir de JObject.
Références _findMode(), _mode(), _passive(), _putCmd(), _verifyResponse(), et JError::raiseWarning().
& JFTP::getInstance | ( | $ | host = '127.0.0.1' , |
$ | port = '21' , |
||
$ | options = null , |
||
$ | user = null , |
||
$ | pass = null |
||
) |
Returns a reference to the global FTP connector object, only creating it if it doesn't already exist.
This method must be invoked as:
$ftp = &JFTP::getInstance($host);
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 $host, $return, $user, et isConnected().
Référencé par JInstallationHelper::_chmod(), JFolder::copy(), JFile::copy(), JFolder::create(), JFolder::delete(), JFile::delete(), JInstallationHelper::findFtpRoot(), JInstallationHelper::FTPVerify(), JFolder::move(), JFile::move(), JInstallationModel::saveConfig(), JClientHelper::setCredentials(), JInstallationHelper::setDirPerms(), JFile::upload(), et JFile::write().
JFTP::isConnected | ( | ) |
Method to determine if the object is connected to an FTP server
public
Référencé par getInstance().
JFTP::listDetails | ( | $ | path = null , |
$ | type = 'all' |
||
) |
Method to list the contents of a directory on the FTP server
public
string | $path | Path local file to store on the FTP server |
string | $type | Return type [raw|all|folders|files] |
boolean | $search | Recursively search subdirectories |
Références $data, $file, $k, $path, $type, _passive(), _putCmd(), _verifyResponse(), elseif, et JError::raiseWarning().
Référencé par listNames().
JFTP::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
public
string | $path | Path local file to store on the FTP server |
Références $data, $list, $path, _passive(), _putCmd(), _verifyResponse(), listDetails(), et JError::raiseWarning().
JFTP::login | ( | $ | user = 'anonymous' , |
$ | pass = 'jftp@joomla.org' |
||
) |
Method to login to a server once connected
public
string | $user | Username to login to the server |
string | $pass | Password to login to the server |
Références $user, _putCmd(), et JError::raiseWarning().
JFTP::mkdir | ( | $ | path | ) |
Method to create a directory on the FTP server
public
string | $path | Directory to create |
Références $path, _putCmd(), et JError::raiseWarning().
JFTP::pwd | ( | ) |
Method to retrieve the current working directory on the FTP server
public
Références _putCmd(), et JError::raiseWarning().
JFTP::quit | ( | ) |
Method to quit and close the connection
public
Référencé par __destruct().
JFTP::read | ( | $ | remote, |
&$ | buffer | ||
) |
Method to read a file from the FTP server's contents into a buffer
public
string | $remote | Path to remote file to read on the FTP server |
string | $buffer | Buffer variable to read file contents into |
Références _findMode(), _mode(), _passive(), _putCmd(), _verifyResponse(), et JError::raiseWarning().
JFTP::reinit | ( | ) |
Method to reinitialize the server, ie. need to login again
NOTE: This command not available on all servers
public
Références _putCmd(), et JError::raiseWarning().
JFTP::rename | ( | $ | from, |
$ | to | ||
) |
Method to rename a file/folder on the FTP server
public
string | $from | Path to change file/folder from |
string | $to | Path to change file/folder to |
Références _putCmd(), et JError::raiseWarning().
JFTP::restart | ( | $ | point | ) |
Method to restart data transfer at a given byte
public
int | $point | Byte to restart transfer at |
Références _putCmd(), et JError::raiseWarning().
JFTP::setOptions | ( | $ | options | ) |
Set client options
public
array | $options | Associative array of options to set |
Référencé par __construct().
JFTP::store | ( | $ | local, |
$ | remote = null |
||
) |
Method to store a file to the FTP server
public
string | $local | Path to local file to store on the FTP server |
string | $remote | FTP path to file to create |
Références _findMode(), _mode(), _passive(), _putCmd(), _verifyResponse(), et JError::raiseWarning().
JFTP::syst | ( | ) |
Method to system string from the FTP server
public
Références _putCmd(), elseif, et JError::raiseWarning().
JFTP::write | ( | $ | remote, |
$ | buffer | ||
) |
Method to write a string to the FTP server
public
string | $remote | FTP path to file to write to |
string | $buffer | Contents to write to the FTP server |
Références _findMode(), _mode(), _passive(), _putCmd(), _verifyResponse(), et JError::raiseWarning().
JFTP::$_autoAscii = array ("asp", "bat", "c", "cpp", "csv", "h", "htm", "html", "shtml", "ini", "inc", "log", "php", "php3", "pl", "perl", "sh", "sql", "txt", "xhtml", "xml") |
JFTP::$_conn = null |
JFTP::$_dataconn = null |
JFTP::$_lineEndings = array ('UNIX' => "\n", 'MAC' => "\r", 'WIN' => "\r\n") |
JFTP::$_OS = null |
JFTP::$_pasv = null |
JFTP::$_response = null |
JFTP::$_timeout = 15 |
JFTP::$_type = null |