function Drupal::root

Same name in other branches
  1. 9 core/lib/Drupal.php \Drupal::root()
  2. 8.9.x core/lib/Drupal.php \Drupal::root()
  3. 10 core/lib/Drupal.php \Drupal::root()

Gets the app root.

Return value

string

27 calls to Drupal::root()
DbCommandBase::getDatabaseConnection in core/lib/Drupal/Core/Command/DbCommandBase.php
Parse input options decide on a database.
drupal_check_profile in core/includes/install.inc
Checks an installation profile's requirements.
drupal_verify_profile in core/includes/install.inc
Verifies that all dependencies are met for a given installation profile.
EntityFilteringThemeTest::setUp in core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php
ExtensionInstallStorage::getAllFolders in core/lib/Drupal/Core/Config/ExtensionInstallStorage.php
Returns a map of all config object names and their folders.

... See full list

File

core/lib/Drupal.php, line 219

Class

Drupal
Static Service Container wrapper.

Code

public static function root() {
    return static::getContainer()->getParameter('app.root');
}

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