You are here

public static function Settings::initialize in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Site/Settings.php \Drupal\Core\Site\Settings::initialize()

Bootstraps settings.php and the Settings singleton.

Parameters

string $app_root: The app root.

string $site_path: The current site path.

\Composer\Autoload\ClassLoader $class_loader: The class loader that is used for this request. Passed by reference and exposed to the local scope of settings.php, so as to allow it to be decorated with Symfony's ApcClassLoader, for example.

See also

default.settings.php

11 calls to Settings::initialize()
BrowserTestBase::installDrupal in core/modules/simpletest/src/BrowserTestBase.php
Installs Drupal into the Simpletest site.
db-tools.php in core/scripts/db-tools.php
DrupalKernel::initializeSettings in core/lib/Drupal/Core/DrupalKernel.php
Locate site path and initialize settings singleton.
dump-database-d8-mysql.php in core/scripts/dump-database-d8-mysql.php
generate-proxy-class.php in core/scripts/generate-proxy-class.php

... See full list

File

core/lib/Drupal/Core/Site/Settings.php, line 113
Contains \Drupal\Core\Site\Settings.

Class

Settings
Read only settings that are initialized with the class.

Namespace

Drupal\Core\Site

Code

public static function initialize($app_root, $site_path, &$class_loader) {

  // Export these settings.php variables to the global namespace.
  global $config_directories, $config;
  $settings = array();
  $config = array();
  $databases = array();
  if (is_readable($app_root . '/' . $site_path . '/settings.php')) {
    require $app_root . '/' . $site_path . '/settings.php';
  }

  // Initialize Database.
  Database::setMultipleConnectionInfo($databases);

  // Initialize Settings.
  new Settings($settings);
}