Bootstrap Process in Drupal 7

author details
AdiPie
26th Jul 2020
2 mins read
Image
Bootstrap Process in Drupal 7

Drupal 7 comes with the Bootstrap process and incase of drupal page request experiences index.php document which is situated at root folder. 

index.php consist of not many line of code i.e

 define('DRUPAL_ROOT', getcwd());

 require_once DRUPAL_ROOT . '/includes/bootstrap.inc';

 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

 menu_execute_active_handler();

 

  • Defing the constant DRUPAL_ROOT

  define('DRUPAL_ROOT', getcwd());

  • including the bootstrap.inc

 require_once DRUPAL_ROOT . '/includes/bootstrap.inc';

drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

does the initialization. It fundamentally checks for an connection with the database, loads modules, loads required information into memory and so forth. 

  • Handling page demand menu_execute_active_handler() work is utilized, that takes ?q=half of the URL and produces the site page.

There are total 8 phase in bootstrap, which initialize the database, session etc..

<?php

  static $phases = array(

    DRUPAL_BOOTSTRAP_CONFIGURATION,

    DRUPAL_BOOTSTRAP_PAGE_CACHE,

    DRUPAL_BOOTSTRAP_DATABASE,

    DRUPAL_BOOTSTRAP_VARIABLES,

    DRUPAL_BOOTSTRAP_SESSION,

    DRUPAL_BOOTSTRAP_PAGE_HEADER,

    DRUPAL_BOOTSTRAP_LANGUAGE,

    DRUPAL_BOOTSTRAP_FULL,

  );

?>