A Synchronous class to manage and operate with ftp connections
package |
Default |
---|
__construct(string $userName, string $psw, string $host, integer $port = null, integer $timeout = 90)
string
The username for the ftp session we want to start
string
The password for the ftp user
string
The FTP server address. This parameter shouldn't have any trailing slashes and shouldn't be prefixed with ftp://.
integer
This parameter specifies an alternate port to connect to. If it is omitted or set to zero, then the default FTP port, 21, will be used.
integer
This parameter specifies the timeout for all subsequent network operations. If omitted, the default value is 90 seconds. The timeout can be changed and queried at any time
__destruct()
__get(string $name) : void
string
The property name
__set(string $name, string $value) : void
string
The property name
string
The property value
closeConnection() : void
createFile(string $ftpPath, string $fileData = '') : boolean
string
The full ftp path where the file will be stored, including the full file name
string
Information to store on the file (a string, a block of bytes, etc...)
boolean
Returns true on success or false on failure.
downloadFile(string $ftpPath, string $localPath) : boolean
string
The file full ftp path including the file name
string
The local path where the file will be stored, including the filename where the data will be saved.
boolean
True on sucess or false if the download fails
getDirectoryList(string $path = '/') : array
The contents of any subfolder will not be listed. We must call this method for each child folder if we want to get it's list.
string
Full path to the directory we want to list. Example: 'folder/' by default the root ftp folder is used ('/')
array
The list of item names inside the specified path
readFile(string $ftpPath) : string
string
The file full ftp path including the file name
string
The file binary information
lastError :
transferMode :