Class Ftp
FTP wrapper for DiRete\microftps
Namespace: Blesta\Core\Util\Ftp
Located at core/Util/Ftp/Ftp.php
Methods summary
public
|
#
__construct( string $server = '', string $username = '', string $password = '', array $options = [] )
Parameters
- $server
- The IP/domain of the server to connent to
- $username
- The username to connect with
- $password
- The password to connect with
- $options
The options to use for the connection including:
- passive
- port
- timeout
- curlOptions
|
public
|
#
connect( )
Attempts to connect to the FTP server
Attempts to connect to the FTP server
|
public
|
#
setServer( type $server )
Sets the FTP server URL to connect to
Sets the FTP server URL to connect to
Parameters
|
public
|
#
setCredentials( string $username, string $password )
Sets login credentials for the FTP connection
Sets login credentials for the FTP connection
Parameters
- $username
- The FTP username
- $password
- The FTP password
|
public
|
#
setOptions( array $options )
Sets options to use for the FTP connection
Sets options to use for the FTP connection
Parameters
- $options
The options to use for the connection including:
- passive
- port
- timeout
- curlOptions
|
public
mixed
|
#
read( string $path )
Reads the file from the remote system
Reads the file from the remote system
Parameters
- $path
- The path to read the file from the server
Returns
mixed The result
Throws
|
public
mixed
|
#
write( string $from_path, string $to_path )
Writes the file from the local system to the remote system
Writes the file from the local system to the remote system
Parameters
- $from_path
- The path to the local file
- $to_path
- The path to write the file to on the server
Returns
mixed The result
Throws
|
public
mixed
|
#
delete( string $path )
Deletes the remote file at the given path
Deletes the remote file at the given path
Parameters
- $path
- The path to delete the file from the server
Returns
mixed The result
Throws
|
public
array
|
#
listDir( string $dir )
List directory
Parameters
Returns
array
Throws
|
Constants summary
string |
CONNECTION_ERROR
|
#
'Could not connect to FTP server.'
|