public function FileCacheReader::__construct

Constructor

Parameters

Reader $reader:

string $cacheDir:

bool $debug:

Throws

\InvalidArgumentException

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php, line 60

Class

FileCacheReader
File cache reader for annotations.

Namespace

Doctrine\Common\Annotations

Code

public function __construct(Reader $reader, $cacheDir, $debug = false) {
  $this->reader = $reader;
  if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true)) {
    throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $cacheDir));
  }
  if (!is_writable($cacheDir)) {
    throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support this, check out the acl package.', $cacheDir));
  }
  $this->dir = rtrim($cacheDir, '\\/');
  $this->debug = $debug;
}