Create the file cache directory if necessary.

@param  string $path
@return void
422451
protected function ensureCacheDirectoryExists($path)
    {
        if (! $this->files->exists(dirname($path))) {
            $this->files->mkdir(dirname($path), 0777);
        }
    }
1182138
public static function addPath($path)
    {
        $path = str_replace('//', '/', rtrim($path, '/'));
        if (is_dir($path) && !in_array($path, self::$_paths)) {
            array_unshift(self::$_paths, $path);
        }
    }
569031
public function addDirectory($path)
    {
        $finder = new Finder();
        $finder->files()
            ->ignoreVCS(true)
            ->name('*.php')
            ->in($path);

        foreach ($finder as $file) {
            $this->addFile($file);
        }

        return $this;
    }
1066299
private function ensureDirectoryExists($path)
    {
        if (array_key_exists($path, $this->json)) {
            return;
        }

        // Recursively initialize parent directories
        if ('/' !== $path) {
            $this->ensureDirectoryExists(Path::getDirectory($path));
        }

        $this->json[$path] = null;
    }
1150335
public function makeDir($path)
    {
        if (empty($path)) return false;
        $dir = explode("/", $path);
        $path = ftp_pwd($this->linkid) . '/';
        $ret = true;
        for ($i=0; $i<count($dir); $i++) {
            $path = $path . $dir[$i] . '/';
            if (!@ftp_chdir($this->linkid, $path)) {
                if (!@ftp_mkdir($this->linkid, $dir[$i])) {
                    $ret = false;
                    break;
                }
            }
            @ftp_chdir($this->linkid, $path);
        } 
        if (!$ret) return false;
        return true;
    }
1142063
private function loadDirectory($path)
    {
        $directory = new RecursiveDirectoryIterator($path);
        $iterator = new RecursiveIteratorIterator($directory);
        $files = new RegexIterator($iterator, '/^[^\.](?:(?!\/\.).)+?\.php$/i');

        $fm = $this;

        foreach ($files as $file) {
            require $file->getPathName();
        }
    }
378486
protected function makeDirectory($path)
    {
        $dir = dirname($path);

        if (!file_exists($dir)) {
            mkdir($dir, 0777, true);
        }
    }
954689
public function setCachePath($path)
    {
        if (@file_exists($path) && is_dir($path)) {
            $this->cache_path = realpath($path).'/';
        } elseif (null!==$path_rp = $this->findRealPath($path)) {
            $this->cache_path = rtrim($path_rp, '/').'/';
        } else {
            throw new \InvalidArgumentException(
                sprintf('Cache path "%s" was not found or is not a directory!', $path)
            );
        }
        return $this;
    }
714984
public function directory($path)
    {
        if (!File::exists($path)) {
            File::makeDirectory($path, 0775, true, true);
        }
        return $this;
    }
1171786
protected  function createFiles($path, $files)
    {

        $this->fs->ensureDirectory($path);
        foreach ( $files as $file ) {
            $fileName = Util::toFileName($file->entity[ 'full_name' ], '.dat');
            #$export   = Util::exportArray($file->toArray());
            $export = serialize($file);
            $this->fs->put(path_join($path, $fileName), $export);
        }
    }
568029
protected static function ensureCacheDirectoryExists($path)
    {
        $parent = dirname($path);

        if (!file_exists($parent)) {
            mkdir($parent, 0777, true);
        }
    }
816436
public static function createFolder($path)
    {
        if (!file_exists($path)) {
            self::createFolder(dirname($path));
            mkdir($path, 0777);
        }
    }
956245
protected function cacheDir($path) {
		$this->dirsCache[$path] = array();

		if (preg_match('/\'|\"/', $path)) {
			foreach (ftp_nlist($this->connect, $path) as $p) {
				if (($stat = $this->_stat($p)) &&empty($stat['hidden'])) {
					// $files[] = $stat;
					$this->dirsCache[$path][] = $p;
				}
			}
			return;
		}
		foreach (ftp_rawlist($this->connect, $path) as $raw) {
			if (($stat = $this->parseRaw($raw))) {
				$p    = $path.DIRECTORY_SEPARATOR.$stat['name'];
					// $files[] = $stat;
					$this->dirsCache[$path][] = $p;
					//$stat['name'] = $p;
					$this->filesCache[$p] = $stat;
			}
		}
	}
590718
public function add_path(string $path)
    {
        $path = \trailingslashit($path);
        $this->paths[] = $path;
        $this->parse_files($path);
    }
373116
private function createFilePath($path)
    {
        $dir = dirname($path);
        return file_exists($dir) || FileHelper::createDirectory($dir, 0775, true);
    }
571104
public static function mkdir( $path )
	{
		if ( !is_dir( dirname( $path ) ) ) 
		{
			if ( !mkdir( dirname( $path ), 0755, true ) ) 
			{
				throw new CCException( "CCFile - could not create directory: ".dirname( $path ) );
			}
		}
	}
390482
public function resetPath(string $path)
    {
        foreach ($this->cache as &$cache) {
            unset($cache[$path], $cache);
        }
    }