Skip to content

Instantly share code, notes, and snippets.

@totten
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save totten/c1da0f59b0567cd2ad43 to your computer and use it in GitHub Desktop.
Save totten/c1da0f59b0567cd2ad43 to your computer and use it in GitHub Desktop.
Simulate the work of loading all settings at the start of every page request.
diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php
index 58612b1..e922acc 100644
--- a/CRM/Core/Config.php
+++ b/CRM/Core/Config.php
@@ -262,6 +262,11 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
// initialize authentication source
self::$_singleton->initAuthSrc();
+
+ $dao = CRM_Core_DAO::executeQuery('SELECT config_backend FROM civicrm_domain WHERE id = 1');
+ while ($dao->fetch()) {
+ unserialize($dao->config_backend);
+ }
}
return self::$_singleton;
}
diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php
index 58612b1..962cf18 100644
--- a/CRM/Core/Config.php
+++ b/CRM/Core/Config.php
@@ -262,6 +262,11 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
// initialize authentication source
self::$_singleton->initAuthSrc();
+
+ $dao = CRM_Core_DAO::executeQuery('SELECT name, value FROM civicrm_setting WHERE domain_id = 1');
+ while ($dao->fetch()) {
+ unserialize($dao->value);
+ }
}
return self::$_singleton;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment