Skip to content

Instantly share code, notes, and snippets.

@totten totten/sql-sessions.diff Secret
Created Aug 13, 2018

Embed
What would you like to do?
Coerce sessions to use SQL instead of memory-backed storage
diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php
index 6eb4a4d66a..888af46ab0 100644
--- a/Civi/Core/Container.php
+++ b/Civi/Core/Container.php
@@ -160,11 +160,16 @@ class Container {
$container->setDefinition('psr_log', new Definition('CRM_Core_Error_Log', array()));
+ $container->setDefinition("cache.session", new Definition(
+ 'CRM_Utils_Cache_Interface',
+ [['name' => 'CiviCRM Session', 'type' => ['SqlGroup', 'ArrayCache']]]
+ ))->setFactory('CRM_Utils_Cache::create');
+
$basicCaches = array(
'js_strings' => 'js_strings',
'community_messages' => 'community_messages',
'checks' => 'checks',
- 'session' => 'CiviCRM Session',
+ // 'session' => 'CiviCRM Session',
);
foreach ($basicCaches as $cacheSvc => $cacheGrp) {
$container->setDefinition("cache.{$cacheSvc}", new Definition(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.