Obviously there may be occasions when this fails. To ensure that the JFTP object has
successfully connected we can use the isConnected() method:
if (!$client->isConnected())
{
// handle failed FTP connection
}
Most of the available JFTP methods are self explanatory and are standard FTP type
functions. This table describes some of the more common methods we can use with a
JFTP object:
Method Description
quit Closes the FTP connection
pwd
Determines the current working directory. When using the global settings
the root key value should indicate the location of the Joomla! installation.
chdir Changes the current working directory
rename Renames a file or folder
chmod Changes a file or folder mode (permissions)
delete Removes a file or folder
mkdir Creates a new folder
create Creates a new file
read Reads the contents of a file
get Retrieves a file
store Stores a file on the server
listNames List the names of files in the current working directory
listDetails List the names of the files and folders in the current working directory
??? ???
Chapter 10
[ 299 ]
Web Services
There are many Web Service APIs that we can use in conjunction with Joomla!.
Pages:
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411