Permalink
Browse files

allow for environmental PRESSFLOW_SETTINGS to override settings.php

  • Loading branch information...
joshkoenig committed Aug 23, 2011
1 parent 8b61940 commit 673fb0bdab618f8989365012149c76b8397f95d6
Showing with 16 additions and 0 deletions.
  1. +16 −0 includes/bootstrap.inc
View
@@ -554,6 +554,22 @@ function drupal_settings_initialize() {
}
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
+ // Load environmental config, if present.
+ if (isset($_SERVER['PRESSFLOW_SETTINGS'])) {
+ $pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS']);
+ foreach ($pressflow_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);

0 comments on commit 673fb0b

Please sign in to comment.