From c55d4b19f1293be887d7eec01e405d6f43ad9bd2 Mon Sep 17 00:00:00 2001 From: Herb v/d Dool Date: Mon, 21 Mar 2022 17:49:37 -0400 Subject: [PATCH 1/4] Issue #58: apply Pantheon settings so they can be used by settings_get --- settings.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/settings.php b/settings.php index e5fd2b9df..e5c35abb9 100644 --- a/settings.php +++ b/settings.php @@ -473,5 +473,9 @@ * directly from Pantheon to Backdrop. */ if (isset($_SERVER['PRESSFLOW_SETTINGS'])) { - $_SERVER['BACKDROP_SETTINGS'] = $_SERVER['PRESSFLOW_SETTINGS']; + $pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE); + // Apply the Pantheon settings to the Backdrop settings global. + // Note: it will not override any settings set previously. + $pressflow_settings['settings'] = $settings + $pressflow_settings['conf']; + $_SERVER['BACKDROP_SETTINGS'] = json_encode($pressflow_settings); } From 6fd378512f98256863d1496d0e9e8ba61444180b Mon Sep 17 00:00:00 2001 From: Herb Date: Mon, 21 Mar 2022 23:19:00 -0400 Subject: [PATCH 2/4] Update settings.php --- settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.php b/settings.php index e5c35abb9..097a3391e 100644 --- a/settings.php +++ b/settings.php @@ -476,6 +476,6 @@ $pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE); // Apply the Pantheon settings to the Backdrop settings global. // Note: it will not override any settings set previously. - $pressflow_settings['settings'] = $settings + $pressflow_settings['conf']; + $pressflow_settings['settings'] = $pressflow_settings['conf']; $_SERVER['BACKDROP_SETTINGS'] = json_encode($pressflow_settings); } From 5d31dfd385ba562d250ce6618f057dacd4502b02 Mon Sep 17 00:00:00 2001 From: Herb Date: Mon, 21 Mar 2022 23:21:47 -0400 Subject: [PATCH 3/4] Update settings.php --- settings.php | 1 - 1 file changed, 1 deletion(-) diff --git a/settings.php b/settings.php index 097a3391e..c8ce4b443 100644 --- a/settings.php +++ b/settings.php @@ -475,7 +475,6 @@ if (isset($_SERVER['PRESSFLOW_SETTINGS'])) { $pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE); // Apply the Pantheon settings to the Backdrop settings global. - // Note: it will not override any settings set previously. $pressflow_settings['settings'] = $pressflow_settings['conf']; $_SERVER['BACKDROP_SETTINGS'] = json_encode($pressflow_settings); } From 1122989388eedf902bde5d8c5fae593efe528947 Mon Sep 17 00:00:00 2001 From: Herb Date: Tue, 22 Mar 2022 10:26:37 -0400 Subject: [PATCH 4/4] Update settings.php --- settings.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/settings.php b/settings.php index c8ce4b443..c0f7a19ac 100644 --- a/settings.php +++ b/settings.php @@ -469,8 +469,10 @@ /** * Pantheon specific compatibility. * - * Override the database information to pass the correct Database credentials + * Pass the correct Database credentials and environment variables * directly from Pantheon to Backdrop. + * + * @see See https://github.com/backdrop-ops/backdrop-pantheon/issues/58 */ if (isset($_SERVER['PRESSFLOW_SETTINGS'])) { $pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE);