You are here

public function FileCacheReader::__construct in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php \Doctrine\Common\Annotations\FileCacheReader::__construct()

Constructor.

Parameters

Reader $reader:

string $cacheDir:

boolean $debug:

Throws

\InvalidArgumentException

File

modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php, line 64

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));
  }
  $this->dir = rtrim($cacheDir, '\\/');
  $this->debug = $debug;
}