function InfoParserDynamic::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/InfoParserDynamic.php \Drupal\Core\Extension\InfoParserDynamic::__construct()
  2. 8.9.x core/lib/Drupal/Core/Extension/InfoParserDynamic.php \Drupal\Core\Extension\InfoParserDynamic::__construct()
  3. 11.x core/lib/Drupal/Core/Extension/InfoParserDynamic.php \Drupal\Core\Extension\InfoParserDynamic::__construct()

InfoParserDynamic constructor.

Parameters

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

1 call to InfoParserDynamic::__construct()
InfoParser::__construct in core/lib/Drupal/Core/Extension/InfoParser.php
InfoParser constructor.
1 method overrides InfoParserDynamic::__construct()
InfoParser::__construct in core/lib/Drupal/Core/Extension/InfoParser.php
InfoParser constructor.

File

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

Class

InfoParserDynamic
Parses dynamic .info.yml files that might change during the page request.

Namespace

Drupal\Core\Extension

Code

public function __construct(?string $app_root = NULL) {
    if ($app_root === NULL) {
        @trigger_error('Calling InfoParserDynamic::__construct() without the $app_root argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3293709', E_USER_DEPRECATED);
        $app_root = \Drupal::hasService('kernel') ? \Drupal::root() : DRUPAL_ROOT;
    }
    $this->root = $app_root;
}

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