Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By RobLoach on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
The definition of DRUPAL_ROOT has been moved into bootstrap.inc. This removes the need to define it whenever manually bootstrapping Drupal.
Drupal 7
The following is Drupal 7's index.php defining DRUPAL_ROOT
and including bootstrap.inc to bootstrap Drupal:
/**
* Root directory of Drupal installation.
*/
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
Drupal 8
In Drupal 8's index.php, the definition of DRUPAL_ROOT is not required as it's handled in bootstrap.inc:
require_once __DIR__ . '/core/includes/bootstrap.inc';
Impacts:
Module developers