Skip to content
Snippets Groups Projects
Commit 0f0e62c1 authored by David Snopek's avatar David Snopek
Browse files

Update CiviCRM settings per instructions from Pantheon

parent 480d40fa
No related branches found
No related tags found
Loading
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
*/ */
if (!empty($_SERVER['PRESSFLOW_SETTINGS'])) { if (!empty($_SERVER['PRESSFLOW_SETTINGS'])) {
$env = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE); $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_db = $env['databases']['default']['default'];
$pantheon_conf = $env['conf']; $pantheon_conf = $env['conf'];
$pantheon_root = $_ENV['HOME'] . ($_ENV['HOME'] !== '/' ? '/' : '');
//user name and password //user name and password
$db_string = $pantheon_db['driver'] . '://' . $pantheon_db['username'] . ':' . $pantheon_db['password'] . '@'; $db_string = $pantheon_db['driver'] . '://' . $pantheon_db['username'] . ':' . $pantheon_db['password'] . '@';
...@@ -26,13 +27,13 @@ ...@@ -26,13 +27,13 @@
define('CIVICRM_UF_DSN', $db_string); define('CIVICRM_UF_DSN', $db_string);
define('CIVICRM_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'; $civicrm_root = $_SERVER['LANDO_MOUNT'] . '/vendor/civicrm/civicrm-core';
define('CIVICRM_TEMPLATE_COMPILEDIR', $_SERVER['LANDO_WEBROOT'] . '/' . $pantheon_conf['file_private_path'] . '/civicrm/templates_c/'); define('CIVICRM_TEMPLATE_COMPILEDIR', $_SERVER['LANDO_WEBROOT'] . '/' . $pantheon_conf['file_private_path'] . '/civicrm/templates_c/');
} }
else { else {
$civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/vendor/civicrm/civicrm-core'; $civicrm_root = $pantheon_root . '/code/vendor/civicrm/civicrm-core';
define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/private/civicrm/templates_c/'); 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. // 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/'); define('CIVICRM_REAL_TEMPLATE_COMPILEDIR', $_SERVER['PANTHEON_ROLLING_TMP'] . '/civicrm/templates_c/');
...@@ -43,16 +44,6 @@ ...@@ -43,16 +44,6 @@
// Use Drupal base url and path // Use Drupal base url and path
define('CIVICRM_UF_BASEURL', $base_url . '/'); 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:' );
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment