function Drupal::root

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

Gets the app root.

Return value

string

28 calls to Drupal::root()
color_get_info in core/modules/color/color.module
Retrieves the Color module information for a particular theme.
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_required_modules in core/includes/module.inc
Returns an array of modules required by core.
drupal_verify_profile in core/includes/install.inc
Verifies that all dependencies are met for a given installation profile.

... See full list

File

core/lib/Drupal.php, line 229

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.