Networking\InitCmsBundle\Lib\PhpCache::createDir PHP Method

createDir() protected method

protected createDir ( $rootDir, $env ) : string
$rootDir
$env
return string
    protected function createDir($rootDir, $env)
    {
        $cacheDir = $rootDir . sprintf('cache/%s/php_fast_cache', $env);
        if (!file_exists($cacheDir) || !is_writable($cacheDir)) {
            if (!file_exists($cacheDir)) {
                @mkdir($cacheDir, 0777);
            }
            if (!is_writable($cacheDir)) {
                @chmod($cacheDir, 0777);
            }
            if (!file_exists($cacheDir) || !is_writable($cacheDir)) {
                throw new \Exception("Sorry, Please create " . $cacheDir . "/ and SET Mode 0777 or any Writable Permission!", 100);
            }
        }
        return $cacheDir;
    }