Same name and namespace in other branches
  1. 4.7.x includes/common.inc \_drupal_bootstrap_full()
  2. 5.x includes/common.inc \_drupal_bootstrap_full()
  3. 7.x includes/common.inc \_drupal_bootstrap_full()

File

includes/common.inc, line 2726
Common functions that many Drupal modules will need to reference.

Code

function _drupal_bootstrap_full() {
  static $called;
  if ($called) {
    return;
  }
  $called = 1;
  require_once './includes/theme.inc';
  require_once './includes/pager.inc';
  require_once './includes/menu.inc';
  require_once './includes/tablesort.inc';
  require_once './includes/file.inc';
  require_once './includes/unicode.inc';
  require_once './includes/image.inc';
  require_once './includes/form.inc';
  require_once './includes/mail.inc';
  require_once './includes/actions.inc';

  // Set the Drupal custom error handler.
  set_error_handler('drupal_error_handler');

  // Emit the correct charset HTTP header.
  drupal_set_header('Content-Type: text/html; charset=utf-8');

  // Detect string handling method
  unicode_check();

  // Undo magic quotes
  fix_gpc_magic();

  // Load all enabled modules
  module_load_all();

  // Ensure mt_rand is reseeded, to prevent random values from one page load
  // being exploited to predict random values in subsequent page loads.
  $seed = unpack("L", drupal_random_bytes(4));
  mt_srand($seed[1]);

  // Let all modules take action before menu system handles the request
  // We do not want this while running update.php.
  if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') {
    module_invoke_all('init');
  }
}