DRUPAL_ROOT

Same name and namespace in other branches
  1. 9 core/includes/bootstrap.inc \DRUPAL_ROOT
  2. 8.9.x core/includes/bootstrap.inc \DRUPAL_ROOT
  3. 11.x core/includes/bootstrap.inc \DRUPAL_ROOT

Defines the root directory of the Drupal installation.

This strips two levels of directories off the current directory.

54 uses of DRUPAL_ROOT
BrowserHtmlDebugTrait::initBrowserOutputFile in core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php
Creates the directory to store browser output.
ConfigInstallProfileUnmetDependenciesTest::copyTestingOverrides in core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php
Copy the testing_config_overrides install profile.
CredentialForm::getDatabaseTypes in core/modules/migrate_drupal_ui/src/Form/CredentialForm.php
Returns all supported database driver installer objects.
CredentialFormTest::testCredentialFrom in core/modules/migrate_drupal_ui/tests/src/Functional/CredentialFormTest.php
Test the credential form.
CronLoggingUpdateTest::setDatabaseDumpFiles in core/modules/system/tests/src/Functional/Update/CronLoggingUpdateTest.php
Set database dump files to be used.

... See full list

File

core/includes/bootstrap.inc, line 63

Code

define('DRUPAL_ROOT', dirname(__DIR__, 2));

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