PHP Class CloudImageModel, thinksns

Afficher le fichier Open project: medz/thinksns-4

Méthodes publiques

Свойство Type Description
$allowExts 允许上传的文件后缀,留空不作后缀检查
$allowTypes 允许上传的文件类型,留空不做检查
$autoCheck
$customPath 上传文件保存路径
$hashType 上传文件Hash规则函数名,可以是 md5_file sha1_file 等
$maxSize 上传文件的最大值
$saveName
$savePath
$thumb 使用对上传图片进行缩略图处理
$thumbMaxHeight 缩略图最大高度
$thumbMaxWidth 缩略图最大宽度

Méthodes publiques

Méthode Description
__construct ( ) 构造函数
deleteFile ( string $filename ) : boolean 删除文件
getConfig ( ) 获取又拍云配置
getErrorMsg ( ) : string 取得最后一次错误信息
getFileInfo ( $filename )
getImageInfo ( $filename ) 获取上传图片信息
getImageUrl ( $filename, $width, $height, $cut ) 获取上传地址
getPolicy ( ) 获取policy
getPolicydoc ( ) 获取表单API相关信息
getSignature ( ) 获取signature
getUploadFileInfo ( ) : array 取得上传文件的信息
getUploadUrl ( ) 获取上传地址
getUrlPrefix ( ) 获取附件URL前缀
isOpen ( ) 是否开启Upyun
upload ( string $savePath = '' ) : string 上传文件
writeFile ( string $filename, string $filecontent ) : boolean 写入文件

Méthodes protégées

Méthode Description
error ( string $errorNo ) 获取错误代码信息

Private Methods

Méthode Description
check ( array $file ) : boolean 检查上传的文件
checkExt ( string $ext ) : boolean 检查上传的文件后缀是否合法
checkSize ( integer $size ) : boolean 检查文件大小是否合法
checkType ( string $type ) : boolean 检查上传的文件类型是否合法
checkUpload ( string $filename ) : boolean 检查文件是否非法提交
dealFiles ( array $files ) : array 转换上传文件数组变量为正确的方式
getExt ( string $filename ) : boolean 取得上传文件的后缀

Method Details

__construct() public méthode

构造函数
public __construct ( )

deleteFile() public méthode

删除文件
public deleteFile ( string $filename ) : boolean
$filename string 文件相对路径
Résultat boolean

error() protected méthode

获取错误代码信息
protected error ( string $errorNo )
$errorNo string 错误号码

getConfig() public méthode

获取又拍云配置
public getConfig ( )

getErrorMsg() public méthode

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

getFileInfo() public méthode

public getFileInfo ( $filename )

getImageInfo() public méthode

获取上传图片信息
public getImageInfo ( $filename )

getImageUrl() public méthode

获取上传地址
public getImageUrl ( $filename, $width, $height, $cut )

getPolicy() public méthode

获取policy
public getPolicy ( )

getPolicydoc() public méthode

获取表单API相关信息
public getPolicydoc ( )

getSignature() public méthode

获取signature
public getSignature ( )

getUploadFileInfo() public méthode

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

getUploadUrl() public méthode

获取上传地址
public getUploadUrl ( )

getUrlPrefix() public méthode

获取附件URL前缀
public getUrlPrefix ( )

isOpen() public méthode

是否开启Upyun
public isOpen ( )

upload() public méthode

上传文件
public upload ( string $savePath = '' ) : string
$savePath string 上传文件保存路径
Résultat string

writeFile() public méthode

写入文件
public writeFile ( string $filename, string $filecontent ) : boolean
$filename string 文件相对路径
$filecontent string 文件数据
Résultat boolean

Property Details

$allowExts public_oe property

允许上传的文件后缀,留空不作后缀检查
public $allowExts

$allowTypes public_oe property

允许上传的文件类型,留空不做检查
public $allowTypes

$autoCheck public_oe property

public $autoCheck

$customPath public_oe property

上传文件保存路径
public $customPath

$hashType public_oe property

上传文件Hash规则函数名,可以是 md5_file sha1_file 等
public $hashType

$maxSize public_oe property

上传文件的最大值
public $maxSize

$saveName public_oe property

public $saveName

$savePath public_oe property

public $savePath

$thumb public_oe property

使用对上传图片进行缩略图处理
public $thumb

$thumbMaxHeight public_oe property

缩略图最大高度
public $thumbMaxHeight

$thumbMaxWidth public_oe property

缩略图最大宽度
public $thumbMaxWidth