Settings::initialize

public static Settings::initialize($app_root, $site_path, &$class_loader)

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

File

core/lib/Drupal/Core/Site/Settings.php, line 108

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);
}
doc_Drupal
2016-10-29 09:42:14
Comments
Leave a Comment

Please login to continue.