You are here

public function AnnotationReader::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php \Doctrine\Common\Annotations\AnnotationReader::__construct()

Constructor.

Initializes a new AnnotationReader.

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php, line 155

Class

AnnotationReader
A reader for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

public function __construct() {
  if (extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.save_comments') === "0" || ini_get('opcache.save_comments') === "0")) {
    throw AnnotationException::optimizerPlusSaveComments();
  }
  if (extension_loaded('Zend OPcache') && ini_get('opcache.save_comments') == 0) {
    throw AnnotationException::optimizerPlusSaveComments();
  }
  if (PHP_VERSION_ID < 70000) {
    if (extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.load_comments') === "0" || ini_get('opcache.load_comments') === "0")) {
      throw AnnotationException::optimizerPlusLoadComments();
    }
    if (extension_loaded('Zend OPcache') && ini_get('opcache.load_comments') == 0) {
      throw AnnotationException::optimizerPlusLoadComments();
    }
  }
  AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php');
  $this->parser = new DocParser();
  $this->preParser = new DocParser();
  $this->preParser
    ->setImports(self::$globalImports);
  $this->preParser
    ->setIgnoreNotImportedAnnotations(true);
  $this->phpParser = new PhpParser();
}