think\File::checkPath PHP Method

checkPath() protected method

检查目录是否可写
protected checkPath ( string $path ) : boolean
$path string 目录
return boolean
    protected function checkPath($path)
    {
        if (is_dir($path)) {
            return true;
        }
        if (mkdir($path, 0755, true)) {
            return true;
        } else {
            $this->error = "目录 {$path} 创建失败!";
            return false;
        }
    }