Smart.Framework Logo

final class \SmartFtpClient
{ } ->

Class: SmartFtpClient - provides a FTP Client with support for common FTP protocol. In addition it supports the extended Hylafax FTP protocol.


class Methods

public function __construct ( $debug = false, $timeout = 30 ) {} @ 
Class Constructor
public function ftp_connect ( $server, $port = 21 ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP Connect :: Connect to a FTP Server
public function ftp_login ( $user, $pass ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP Login :: Authenticate on FTP Server using a username and a password
public function ftp_pwd ( ) {} -> MIXED
@return: {MIXED} On Success return Reponse String ; If Failure return FALSE
FTP PWD :: Get the current path on FTP server
public function ftp_size ( $pathname ) {} -> INTEGER
@return: {INTEGER} On Success return the SIZE ; If Failure return -1
FTP SIZE :: The size of a file on server
public function ftp_mdtm ( $pathname ) {} -> INTEGER
@return: {INTEGER} On Success return the LAST MODIF TIME ; If Failure return -1
FTP MDTM :: Last Modification Time for a PATH on FTP server
public function ftp_systype ( ) {} -> MIXED
@return: {MIXED} On Success return Reponse String ; If Failure return FALSE
FTP SYST :: Asks FTP Server for information about the server's operating system
public function ftp_cdup ( ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP CDUP :: Change directory to parent directory on FTP server
public function ftp_chdir ( $pathname ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP CWD :: Change to a new directory on FTP server
public function ftp_delete ( $pathname ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP DELE :: Delete a file on FTP server
public function ftp_rmdir ( $pathname ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP RMD :: Remove a directory on FTP server
public function ftp_mkdir ( $pathname ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP MKD :: Create a new directory on FTP server
public function ftp_file_exists ( $pathname ) {} -> ENUM
@return: {ENUM} If Exists return 1 ; If Not Exists return 0 ; If Error return -1
FTP Check If File Exists on server
public function ftp_rename ( $from, $to ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP RNFR/RNTO :: Rename a file or a directory on FTP server
public function ftp_nlist ( $arg = "", $pathname = "" ) {} -> MIXED
@return: {MIXED} The list of files as ARRAY or FALSE on error
FTP NLST :: Get the Files List on a FTP Server
Unlike the FTP LIST command, the server will send only the list of files and no other information on those files
public function ftp_rawlist ( $pathname = "" ) {} -> MIXED
@return: {MIXED} The list of files as ARRAY or FALSE on error
FTP LIST :: Get the Raw Files List on a FTP Server
Unlike the FTP NLST command, the server will send all information on those files
public function ftp_get ( $localfile, $remotefile, $mode = 1 ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP GET :: Get a file from FTP server and store locally
public function ftp_put ( $remotefile, $localfile, $mode = 1 ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP PUT :: Put a local file on FTP server and store remote
public function ftp_site ( $command ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP SITE :: Ask FTP server to accept non-standard FTP commands that may not be universally supported by the FTP standard protocol
public function ftp_extcmd ( $command ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
FTP EXTENDED Command :: Send an extra and non-standard FTP command to the FTP Server that may not be universally supported by the FTP standard protocol
public function ftp_extcmdx ( $command ) {} -> MIXED
@return: {MIXED} If Success return a string with the server's answer ; If Failure return FALSE
FTP EXTENDED Command :: Send an extra and non-standard FTP command to the FTP Server that returns an answer and that may not be universally supported by the FTP standard protocol
public function ftp_quit ( ) {} -> BOOLEAN
@return: {BOOLEAN} If Success return TRUE ; If Failure return FALSE
Sends the QUIT command to the FTP server
Closes the communication socket after sending QUIT command

class Properties

public $error_msg -> STRING
Error Message(s) Collector
If any error occurs will be set here
default ''
public $debug = FALSE ;  -> BOOLEAN
to debug or not
public $debug_level = '' ;  -> ENUM
debug level '' as standard, log only responses | 'full' as full, log both requests and responses
public $debug_msg -> STRING
Debug Log Collector
If Debug, this will return the partial or full Log as string, depend on how $debug_level is set
default ''
public $timeout = 30 ;  -> INTEGER+
Connect timeout in seconds

class Constants



documentation generated on: 2023-10-19 23:15:58 +0000


Smart.Framework © 2009-2023 unix-world.org