PHP Class Ftp

Uso: $ftp = new Ftp('servidorFtp','usuario','password'); Subir archivo: $ok = $ftp->upload('carpetaDestino','archivoOrigen','archivoDestino'); Descargar archivo: $ok = $ftp->downLoad('archivoDelServidor','archivoLocal'); Cerrar sesion: $ftp->close(); Obtener eventuales errores: $array = $ftp->getErrores();
Author: Sergio Pérez ([email protected])
显示文件 Open project: dg/ftp-php Class Usage Examples

Public Methods

Method Description
__call ( $name, $args ) : mixed Magic method (do not call directly).
__construct ( $url = NULL, $passiveMode = TRUE )
_errorHandler ( $code, $message ) Internal error handler. Do not call directly.
deleteRecursive ( $path ) : void Recursive deletes path.
fileExists ( $file ) : boolean Checks if file or directory exists.
isDir ( $dir ) : boolean Checks if directory exists.
mkDirRecursive ( $dir ) : void Recursive creates directories.
reconnect ( ) : void Reconnects to FTP server.

Method Details

__call() public method

Magic method (do not call directly).
public __call ( $name, $args ) : mixed
return mixed

__construct() public method

public __construct ( $url = NULL, $passiveMode = TRUE )

_errorHandler() public method

Internal error handler. Do not call directly.
public _errorHandler ( $code, $message )

deleteRecursive() public method

Recursive deletes path.
public deleteRecursive ( $path ) : void
return void

fileExists() public method

Checks if file or directory exists.
public fileExists ( $file ) : boolean
return boolean

isDir() public method

Checks if directory exists.
public isDir ( $dir ) : boolean
return boolean

mkDirRecursive() public method

Recursive creates directories.
public mkDirRecursive ( $dir ) : void
return void

reconnect() public method

Reconnects to FTP server.
public reconnect ( ) : void
return void