diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 0b81dc0..1a95009 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -718,6 +718,22 @@ function drupal_settings_initialize() { } $is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on'; + // Load environmental config, if present. + if (isset($_SERVER['DRUPAL_SETTINGS'])) { + $env_settings = json_decode($_SERVER['DRUPAL_SETTINGS'], TRUE); + foreach ($env_settings as $key => $value) { + // One level of depth should be enough for $conf and $database. + if ($key == 'conf') { + foreach($value as $conf_key => $conf_value) { + $conf[$conf_key] = $value; + } + } + else { + $$key = $value; + } + } + } + if (isset($base_url)) { // Parse fixed base URL from settings.php. $parts = parse_url($base_url);