From 0f0e62c12861d2690e90db22fde5e072c1a700db Mon Sep 17 00:00:00 2001
From: David Snopek <dsnopek@gmail.com>
Date: Mon, 25 May 2020 09:39:49 -0500
Subject: [PATCH] Update CiviCRM settings per instructions from Pantheon

---
 web/sites/default/civicrm.settings.php | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/web/sites/default/civicrm.settings.php b/web/sites/default/civicrm.settings.php
index 5b7938b913..eff0f69aaf 100644
--- a/web/sites/default/civicrm.settings.php
+++ b/web/sites/default/civicrm.settings.php
@@ -11,9 +11,10 @@
  */
 if (!empty($_SERVER['PRESSFLOW_SETTINGS'])) {
   $env = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE);
-  if (!empty($env['conf']['pantheon_binding'])) {
+  if (!empty($env['conf']['pantheon_environment'])) {
     $pantheon_db = $env['databases']['default']['default'];
     $pantheon_conf = $env['conf'];
+    $pantheon_root = $_ENV['HOME'] . ($_ENV['HOME'] !== '/' ? '/' : '');
 
     //user name and password
     $db_string = $pantheon_db['driver'] . '://' . $pantheon_db['username'] . ':' . $pantheon_db['password'] . '@';
@@ -26,13 +27,13 @@
     define('CIVICRM_UF_DSN', $db_string);
     define('CIVICRM_DSN', $db_string);
 
-    if ($pantheon_conf['pantheon_binding'] === 'lando') {
+    if ($pantheon_conf['pantheon_environment'] === 'lando') {
       $civicrm_root = $_SERVER['LANDO_MOUNT'] . '/vendor/civicrm/civicrm-core';
       define('CIVICRM_TEMPLATE_COMPILEDIR', $_SERVER['LANDO_WEBROOT'] . '/' . $pantheon_conf['file_private_path'] . '/civicrm/templates_c/');
     }
     else {
-      $civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/vendor/civicrm/civicrm-core';
-      define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/private/civicrm/templates_c/');
+      $civicrm_root = $pantheon_root . '/code/vendor/civicrm/civicrm-core';
+      define('CIVICRM_TEMPLATE_COMPILEDIR', $pantheon_root . '/files/private/civicrm/templates_c/');
 
       // For our custom hack to move just the templates_c directory to a special place.
       define('CIVICRM_REAL_TEMPLATE_COMPILEDIR', $_SERVER['PANTHEON_ROLLING_TMP'] . '/civicrm/templates_c/');
@@ -43,16 +44,6 @@
 
     // Use Drupal base url and path
     define('CIVICRM_UF_BASEURL', $base_url . '/');
-
-    // Use Redis cache.
-    if (!empty($pantheon_conf['redis_client_password'])) {
-      define( 'CIVICRM_DB_CACHE_CLASS', 'Redis' );
-      define( 'CIVICRM_DB_CACHE_HOST', $pantheon_conf['redis_client_host'] );
-      define( 'CIVICRM_DB_CACHE_PORT', $pantheon_conf['redis_client_port'] );
-      define( 'CIVICRM_DB_CACHE_PASSWORD', $pantheon_conf['redis_client_password'] );
-      define( 'CIVICRM_DB_CACHE_TIMEOUT', 3600 );
-      define( 'CIVICRM_DB_CACHE_PREFIX', 'pantheon-redis-civicrm:' );
-    }
   }
 }
 
-- 
GitLab