PHP Class org\upload\driver\Sae

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

Public Methods

Method Description
__construct ( mixed $config = null ) 构造函数,设置storage的domain, 如果有传配置,则domain为配置项,如果没有传domain为第一个路径的目录名称。
checkRootPath ( string $rootpath ) : boolean 检测上传根目录
checkSavePath ( string $savepath ) : boolean 检测上传目录
getError ( ) : string 获取最后一次上传错误信息
mkdir ( )
save ( array &$file, boolean $replace = true ) : boolean 保存指定文件

Method Details

__construct() public method

构造函数,设置storage的domain, 如果有传配置,则domain为配置项,如果没有传domain为第一个路径的目录名称。
public __construct ( mixed $config = null )
$config mixed 上传配置

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 ( )

save() public method

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