Skip to content

Instantly share code, notes, and snippets.

@herbdool
Created April 17, 2015 01:43
Show Gist options
  • Save herbdool/ea8487a5698b62b6e5eb to your computer and use it in GitHub Desktop.
Save herbdool/ea8487a5698b62b6e5eb to your computer and use it in GitHub Desktop.
Pantheon redis settings
diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template
index 41518ca..21dc8fe 100644
--- a/templates/CRM/common/civicrm.settings.php.template
+++ b/templates/CRM/common/civicrm.settings.php.template
@@ -281,6 +281,22 @@ if (!defined('CIVICRM_DOMAIN_ID')) {
*/
/**
+* Redis Caching
+* Using Redis Caching via an extention instead of database -- uncomment below to use.
+* based on https://github.com/ChrisChinchilla/com.schwartzmedia.rediscache
+*/
+
+if (!empty($pantheon_conf['redis_client_host'])) {
+ 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:' );
+
+} else {
+
+/**
* If you have a memcache server configured and want CiviCRM to make use of it,
* set the following constant. You should only set this once you have your memcache
* server up and working, because CiviCRM will not start up if your server is
@@ -332,6 +348,8 @@ if (!defined('CIVICRM_MEMCACHE_PREFIX')) {
define( 'CIVICRM_MEMCACHE_PREFIX', '' );
}
+} // end Pantheon Redis check
+
/**
* If you have multilingual site and you are using the "inherit CMS language"
* configuration option, but wish to, for example, use fr_CA instead of the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment