PHP Class org\upload\driver\Ftp

Datei anzeigen Open project: top-think/thinkphp-extend

Public Methods

Method Description
__construct ( array $config ) 构造函数,用于设置上传根路径
__destruct ( ) 析构方法,用于断开当前FTP连接
checkRootPath ( string $rootpath ) : boolean 检测上传根目录
checkSavePath ( string $savepath ) : boolean 检测上传目录
getError ( ) : string 获取最后一次上传错误信息
mkdir ( string $savepath ) : boolean 创建目录
save ( array $file, boolean $replace = true ) : boolean 保存指定文件

Private Methods

Method Description
login ( ) : boolean 登录到FTP服务器

Method Details

__construct() public method

构造函数,用于设置上传根路径
public __construct ( array $config )
$config array FTP配置

__destruct() public method

析构方法,用于断开当前FTP连接
public __destruct ( )

checkRootPath() public method

检测上传根目录
public checkRootPath ( string $rootpath ) : boolean
$rootpath string 根目录
return boolean true-检测通过,false-检测失败

checkSavePath() public method

检测上传目录
public checkSavePath ( string $savepath ) : boolean
$savepath string 上传目录
return boolean 检测结果,true-通过,false-失败

getError() public method

获取最后一次上传错误信息
public getError ( ) : string
return string 错误信息

mkdir() public method

创建目录
public mkdir ( string $savepath ) : boolean
$savepath string 要创建的目录
return boolean 创建状态,true-成功,false-失败

save() public method

保存指定文件
public save ( array $file, boolean $replace = true ) : boolean
$file array 保存的文件信息
$replace boolean 同名文件是否覆盖
return boolean 保存状态,true-成功,false-失败