function _drupal_bootstrap_configuration
Sets up the script environment and loads settings.php.
1 call to _drupal_bootstrap_configuration()
- drupal_bootstrap in includes/
bootstrap.inc - Ensures Drupal is bootstrapped to the specified phase.
File
-
includes/
bootstrap.inc, line 2711
Code
function _drupal_bootstrap_configuration() {
// Set the Drupal custom error handler.
set_error_handler('_drupal_error_handler');
set_exception_handler('_drupal_exception_handler');
drupal_environment_initialize();
// Start a page timer:
timer_start('page');
// Initialize the configuration, including variables from settings.php.
drupal_settings_initialize();
// Check trusted HTTP Host headers to protect against header attacks.
if (PHP_SAPI !== 'cli') {
$host_patterns = variable_get('trusted_host_patterns', array());
if (!empty($host_patterns)) {
if (!drupal_check_trusted_hosts($_SERVER['HTTP_HOST'], $host_patterns)) {
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
print 'The provided host name is not valid for this server.';
exit;
}
}
}
// Sanitize unsafe keys from the request.
DrupalRequestSanitizer::sanitize();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.