PHP Class Cml\Vendor\UploadFile

Afficher le fichier Open project: linhecheng/cmlphp

Méthodes publiques

Méthode Description
__construct ( array $config = [] ) 构造方法
__get ( $name ) : null 魔术方法快速获取配置
__isset ( $name ) 魔术方法查询是否存在配置项
__set ( string $name, string $value ) : void 魔术方法,快速配置参数
getErrorInfo ( ) : string 取得最后一次错误信息
getSuccessInfo ( ) : array 取得上传文件的信息
upload ( null | string $savePath = null ) : boolean 上传所有文件

Private Methods

Méthode Description
checkExt ( string $ext ) : boolean 检查上传的文件后缀是否合法
checkType ( string $type ) : boolean 查检文件的mime类型是否合法
getSaveName ( string $savepath, string $filename ) : string 根据上传文件命名规则取得保存文件名
save ( array $file ) : boolean 保存
secureCheck ( array $file ) : boolean 检查上传的文件有没上传成功是否合法
workingFiles ( $files ) : array 把同一个选框名有多个文件的上传信息转换成跟 单个文件一样的数组

Method Details

__construct() public méthode

构造方法
public __construct ( array $config = [] )
$config array

__get() public méthode

魔术方法快速获取配置
public __get ( $name ) : null
$name
Résultat null

__isset() public méthode

魔术方法查询是否存在配置项
public __isset ( $name )
$name

__set() public méthode

魔术方法,快速配置参数
public __set ( string $name, string $value ) : void
$name string
$value string
Résultat void

getErrorInfo() public méthode

取得最后一次错误信息
public getErrorInfo ( ) : string
Résultat string

getSuccessInfo() public méthode

取得上传文件的信息
public getSuccessInfo ( ) : array
Résultat array

upload() public méthode

上传所有文件
public upload ( null | string $savePath = null ) : boolean
$savePath null | string 上传文件的保存路径
Résultat boolean