创建多层文件目录
@param 	string 		$path			需要创建路径
@return 	boolean     成功时返回true，失败则返回false;
340352
public static function makeFileDirs($path) {
        //必须考虑 "/" 和 "\" 两种目录分隔符
        $files = preg_split('/[\/|\\\]/s', $path);
        $_dir = '';
        foreach ($files as $value) {
            $_dir .= $value.DIRECTORY_SEPARATOR;
            if ( !file_exists($_dir) ) {
                mkdir($_dir);
            }
        }
        return true;
	}
1161298
protected function checkPath($path)
    {
        if (is_dir($path)) {
            return true;
        }
        if (mkdir($path, 0755, true)) {
            return true;
        } else {
            return false;
        }
    }
155949
public function rmdir($path)
    {
        $path = $this->realpath($path) . '/';
        $length = strlen($path);
        foreach (array_keys($this->files) as $filename) {
            if (substr($filename, 0, $length) === $path) {
                return false;
            }
        }
        $this->at($path, null);
        return true;
    }
828162
public function delete($path)
    {
        if (false === $json = $this->runRequest($path, 'DELETE')) {
            return false;
        }

        return $this->decode($json);
    }
478062
public function delete($path)
    {
        $path = $this->applyPathPrefix($path);
        $object = $this->bucket->object($path);

        if (false === $object->exists()) {
            return true;
        }

        $object->delete();

        return !$object->exists();
    }
452152
public static function delDir($path)
    {
        $succeed = true;
        if (is_dir($path)){
            $objDir = opendir($path);
            while (false !== ($fileName = readdir($objDir))){
                if (($fileName != '.') && ($fileName != '..')){
                    chmod("$path/$fileName", 0777);
                    if (!is_dir("$path/$fileName")){
                        if (!unlink("$path/$fileName")){
                            $succeed = false;
                            break;
                        }
                    }
                    else{
                        self::delDir("$path/$fileName");
                    }
                }
            }
            if (!readdir($objDir)){
                closedir($objDir);
                if (!rmdir($path)){
                    $succeed = false;
                }
            }
        }
        return $succeed;
    }
1270214
public function getFolder($path = '')
    {
        $this->connect();

        $path = trim($path, '/');

        if (file_exists($this->scheme . '/' . $path))
        {

            $result = [ 'folders' => $this->listSubFolder($path), 'files' => $this->listFiles($path) ];

            $folder = new Folder($path, $result);

            return $folder;
        }

        return false;
    }
120034
public static function createFolder($path)
    {
        $path = self::resolve($path);

        return $path && (is_dir($path) || mkdir($path, 0700, true));
    }
372111
public function rmdir($path)
    {
        $files = array_diff(scandir($path), array('.', '..'));
        foreach ($files as $file) {
            (is_dir("$path/$file")) ? $this->rmdir("$path/$file") : unlink("$path/$file");
        }
        return rmdir($path);
    }
700068
public static function read($path)
    {
        $path = Normalize::diskFullPath($path);

        if (!self::exist($path)) {
            return false;
        }

        return @file_get_contents($path);
    }
1081794
public function remove( $path )
    {
        if ( null === $this->identity )
        {
            return false;
        }

        if ( is_array( $path ) || is_object( $path ) )
        {
            $result = array();

            foreach ( $path as $key => $p )
            {
                $result[$key] = $this->remove( $p );
            }

            return $result;
        }

        $path = $this->realPath( $path );
        $base = $this->baseUrl . ( empty( $path ) ? '' : '/' . $path );
        $full = realpath( $this->baseDir . '/' . $base );

        if ( empty( $path ) ) // prevent delete root
        {
            return false;
        }

        $isDir  = is_dir( $full );
        $isFile = is_file( $full );

        if ( $isDir || $isFile )
        {
            $rights = $this->rights( $path );

            if ( $rights->delete )
            {
                switch ( true )
                {
                    case $isDir:
                        return $this->_rmdir( $full );

                    case $isFile:
                        return @ unlink( $full );
                }
            }
        }

        return false;
    }
732190
public function checkPath($path)
    {
        $path = realpath($path);

        return ($path !== false && is_dir($path)) ? $path : false;
    }
808967
public static function mkdir($path)
    {
        $path = Yii::getAlias($path);
        $path = rtrim(trim($path), '/');
        if (!file_exists($path)) {
            mkdir($path, 0777, true);
            Yii::warning('Created dir:  ' . $path . '/', 'file');

            return true;
        }

        return false;
    }
482559
public function delete($path)
    {
        $this->ftp->chdir($this->getDefaultPath());
        $result = $this->ftp->delete($path);
        if (!$result) {
            $files = $this->ftp->nlist($path);
            if ($files && is_array($files)) {
                foreach ($files as $file) {
                    $this->delete($file);
                }

                return $this->ftp->rmdir($path);
            }

            return false;
        }
    }
1017277
protected static function isValidPath($path)
    {
        if (strpos($path, '?') !== false) {
            return false;
        }
        if (strpos($path, '*') !== false) {
            return false;
        }
        if (strpos($path, ':') !== false) {
            return false;
        }
        if (strpos($path, '|') !== false) {
            return false;
        }
        if (strpos($path, '\\') !== false) {
            return false;
        }
        if (strpos($path, '<') !== false) {
            return false;
        }
        if (strpos($path, '>') !== false) {
            return false;
        }
        if (strpos($path, '"') !== false) {
            return false;
        }

        return true;
    }
490272
public function saveDirectory(string $path) : bool
    {
        $this->obfuscated_path = rtrim($path, "/");
        if(is_dir($this->obfuscated_path) === false) {
            $this->addErrorMessage("The specified directory does not exist");
            return false;
        }

        if (is_writable($this->obfuscated_path) == false) {
            $this->addErrorMessage("No permissions to write to the directory");
            return false;
        }

        if ($this->obfuscateDirectoryDeep($this->plain_path, $this->obfuscated_path) == true ) {
            // Diretório ofuscado com sucesso,
            // gera o autoloader
            return $this->setupAutoloader();
        }

        return false;
    }
1367537
public function createFile($path)
    {
        $node = $this->at($path);
        if ($node !== null && $node->type == 'dir') {
            return false;
        }

        $node = $this->at(dirname($path));
        if (null === $node) {
            return false;
        }

        $this->at($path, (object) [
            'type' => 'file',
            'perms' => 0664,
            'content' => ''
        ]);
        return true;
    }