Skip to content

Commit 673fb0b

Browse files
author
Josh Koenig
committed
allow for environmental PRESSFLOW_SETTINGS to override settings.php
1 parent 8b61940 commit 673fb0b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

includes/bootstrap.inc

+16
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,22 @@ function drupal_settings_initialize() {
554554
}
555555
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
556556

557+
// Load environmental config, if present.
558+
if (isset($_SERVER['PRESSFLOW_SETTINGS'])) {
559+
$pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS']);
560+
foreach ($pressflow_settings as $key => $value) {
561+
// One level of depth should be enough for $conf and $database.
562+
if ($key == 'conf') {
563+
foreach($value as $conf_key => $conf_value) {
564+
$conf[$conf_key] = $value;
565+
}
566+
}
567+
else {
568+
$$key = $value;
569+
}
570+
}
571+
}
572+
557573
if (isset($base_url)) {
558574
// Parse fixed base URL from settings.php.
559575
$parts = parse_url($base_url);

0 commit comments

Comments
 (0)