1 bootstrap.inc _backdrop_bootstrap_configuration()

Sets up the script environment and loads settings.php.


core/includes/bootstrap.inc, line 3012
Functions that need to be loaded on every Backdrop request.


function _backdrop_bootstrap_configuration() {
  // Start a page timer:
  // Initialize the configuration, including variables from settings.php.
  // Sanitize input from $_GET, $_POST, etc.

  // Set the Backdrop custom error handler.

  // Load configuration classes and functions.
  require_once BACKDROP_ROOT . '/core/includes/config.inc';

  // Redirect the user to the installation script if Backdrop has not been
  // installed yet (i.e., if no $databases array has been defined in the
  // settings.php file) and we are not already installing.
  if (empty($GLOBALS['databases']) && !backdrop_installation_attempted()) {
    include_once BACKDROP_ROOT . '/core/includes/install.inc';

  // Untrusted host names, throw an exception for the end-user.
  if (!defined('MAINTENANCE_MODE') && !backdrop_check_trusted_hosts($_SERVER['HTTP_HOST'])) {
    throw new Exception(format_string('The HTTP Host "@hostname" is not white-listed for this site. Check the trusted_host_patterns setting in settings.php.', array('@hostname' => $_SERVER['HTTP_HOST'])));

  // Check that the config directory is not empty.
  if (!defined('MAINTENANCE_MODE') && ($config_storage = config_get_config_storage('active'))) {
    if (!($config_storage->exists('system.core') || $config_storage->exists('system.performance'))) {
      $directory = config_get_config_directory('active');
      throw new Exception("The configuration directory in settings.php is specified as '$directory', but this directory is either empty or missing crucial files. Check that the \$config_directories variable is correct in settings.php.");