Functions

Function Description
changeToParentDirectory Changes the current working directory to its parent.
changeDirectory Changes the current working directory to given path.
connect Connects to a server.
createDirectory Creates a directory.
deleteDirectory Deletes a given directory (it must be empty to be deleted).
deleteFile Deletes a given directory (it must be empty to be deleted).
disconnect Closes the FTP connection.
downloadFile Downloads a file from the FTP server.
getCurrentDirectory Returns the name of the current working directory.
getDirectoryContents Returns parsed directory information.
getRawDirectoryContents Calls a direct LIST command to the FTP server and returns the results.
getSystemType This is here for method compatibility with BigTreeFTP but doesn't do anything.
login Login to the SFTP host.
rename Renames a file or directory.
setTransferType This is here for compatibility with BigTreeFTP but doesn't do anything.
uploadFile Uploads a file to the FTP server.

changeToParentDirectory

Changes the current working directory to its parent.

Return Value: true if successful

changeToParentDirectory()

changeDirectory

Changes the current working directory to given path.

Return Value: true if successful

changeDirectory($path)
Parameter Description
$path Full directory path to change to.

connect

Connects to a server.

Return Value: true if successful

connect($host, $port = 22)
Parameter Description
$host The hostname of the server
$port The port to connect to (defaults to 22)

createDirectory

Creates a directory.

Return Value: true if successful.

createDirectory($path)
Parameter Description
$path Full directory path to create or a path relative to the current directory.

deleteDirectory

Deletes a given directory (it must be empty to be deleted).

Return Value: true if successful

deleteDirectory($path)
Parameter Description
$path The full directory path or relative to the current directory.

deleteFile

Deletes a given directory (it must be empty to be deleted).

Return Value: true if successful

deleteFile($path)
Parameter Description
$path The full file path or path relative to the current directory.

disconnect

Closes the FTP connection.

disconnect()

downloadFile

Downloads a file from the FTP server.

Return Value: true if successful.

downloadFile($remote, $local)
Parameter Description
$remote The full path to the file to download (or the path relative to the current directory).
$local The local path to store the downloaded file.

getCurrentDirectory

Returns the name of the current working directory.

Return Value: The current working directory or false if the call failed.

getCurrentDirectory()

getDirectoryContents

Returns parsed directory information.

Return Value: An array of parsed information.

getDirectoryContents($path = "")
Parameter Description
$path Optional directory to search, otherwises uses the current directory.

getRawDirectoryContents

Calls a direct LIST command to the FTP server and returns the results.

Return Value: An array of information from the FTP LIST command.

getRawDirectoryContents($path = "")
Parameter Description
$path Optional directory to search, otherwises uses the current directory.

getSystemType

This is here for method compatibility with BigTreeFTP but doesn't do anything.

getSystemType()

login

Login to the SFTP host.

Return Value: true if successful

login($user = null, $pass = null)
Parameter Description
$user SFTP username.
$pass SFTP password.

rename

Renames a file or directory.

Return Value: true if successful

rename($from, $to)
Parameter Description
$from The current file/directory name (either absolute path or relative to current directory).
$to The new file/directory name (either absolute path or relative to current directory).

setTransferType

This is here for compatibility with BigTreeFTP but doesn't do anything.

setTransferType()

uploadFile

Uploads a file to the FTP server.

Return Value: true if successful

uploadFile($local, $remote)
Parameter Description
$local The full path to the file to upload.
$remote The full path to store the file at (or relative path to the current directory).