public function InfoParserDynamic::__construct in Drupal 8
Same name and namespace in other branches
- 9 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\ExtensionCode
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;
}