function InfoParser::__construct

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Extension/InfoParser.php \Drupal\Core\Extension\InfoParser::__construct()

InfoParser constructor.

Parameters

string|null $app_root: The root directory of the Drupal installation.

Overrides InfoParserDynamic::__construct

File

core/lib/Drupal/Core/Extension/InfoParser.php, line 27

Class

InfoParser
Parses extension .info.yml files.

Namespace

Drupal\Core\Extension

Code

public function __construct(?string $app_root = NULL) {
    parent::__construct($app_root);
    if (FileCacheFactory::getPrefix() !== NULL) {
        $this->fileCache = FileCacheFactory::get('info_parser');
    }
    else {
        // Just use a static file cache when there is no prefix. This code path is
        // triggered when info is parsed prior to \Drupal\Core\DrupalKernel::boot()
        // running. This occurs during the very early installer and in some test
        // scenarios.
        $this->fileCache = new FileCache('info_parser', 'info_parser');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.