function InfoParserDynamic::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/InfoParserDynamic.php \Drupal\Core\Extension\InfoParserDynamic::__construct()
  2. 10 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.

File

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

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) {
        // @todo https://www.drupal.org/project/drupal/issues/3087975 Require
        //   $app_root argument.
        $app_root = \Drupal::hasService('app.root') ? (string) \Drupal::service('app.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.