#### File
~~~
$file = new File('test.txt', 'a');
//是否測試
$file->isTest($test = false);
// 設置上傳信息
$file->setUploadInfo($info);
// 獲取上傳文件的信息
$file->getInfo($name = '');
// 獲取上傳文件的文件名
$file->getSaveName();
// 設置上傳文件的保存文件名
$file->setSaveName($saveName);
// 獲取文件的哈希散列值
$file->hash($type = 'sha1');
// 檢查目錄是否可寫
$this->checkPath($path);
// 獲取文件類型信息
$file->getMime();
// 設置文件的命名規則
$file->rule($rule);
// 設置上傳文件的驗證規則
$file->validate($rule = []);
// 檢測是否合法的上傳文件
$file->isValid();
// 檢測上傳文件
$file->check($rule = []);
// 檢測上傳文件后綴
$file->checkExt($ext);
// 檢測圖像文件
$file->checkImg();
// 判斷圖像類型
$this->getImageType($image);
// 檢測上傳文件大小
$file->checkSize($size);
// 檢測上傳文件類型
$file->checkMime($mime);
/**
* 移動文件
* @param string $path 保存路徑
* @param string|bool $savename 保存的文件名 默認自動生成
* @param boolean $replace 同名文件是否覆蓋
* @return false|SplFileInfo false-失敗 否則返回SplFileInfo實例
*/
$file->move($path, $savename = true, $replace = true);
// 獲取保存文件名
$this->buildSaveName($savename);
// 獲取錯誤代碼信息
$this->error($errorNo);
// 獲取錯誤信息
$file->getError();復制代碼
~~~