Go\Instrument\ClassLoading\CachePathManager::__construct PHP Method

__construct() public method

public __construct ( AspectKernel $kernel )
$kernel Go\Core\AspectKernel
    public function __construct(AspectKernel $kernel)
    {
        $this->kernel = $kernel;
        $this->options = $kernel->getOptions();
        $this->appDir = $this->options['appDir'];
        $this->cacheDir = $this->options['cacheDir'];
        $this->fileMode = $this->options['cacheFileMode'];
        if ($this->cacheDir) {
            if (!is_dir($this->cacheDir)) {
                $cacheRootDir = dirname($this->cacheDir);
                if (!is_writable($cacheRootDir) || !is_dir($cacheRootDir)) {
                    throw new \InvalidArgumentException("Can not create a directory {$this->cacheDir} for the cache.\n                        Parent directory {$cacheRootDir} is not writable or not exist.");
                }
                mkdir($this->cacheDir, $this->fileMode, true);
            }
            if (!$this->kernel->hasFeature(Features::PREBUILT_CACHE) && !is_writable($this->cacheDir)) {
                throw new \InvalidArgumentException("Cache directory {$this->cacheDir} is not writable");
            }
            if (file_exists($this->cacheDir . self::CACHE_FILE_NAME)) {
                $this->cacheState = (include $this->cacheDir . self::CACHE_FILE_NAME);
            }
        }
    }