From: Tim Otten Date: Thu, 21 Jun 2018 05:40:06 +0000 (-0700) Subject: SettingsManager - Use PSR-16 compliant cache key X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=12eaada5ba3b0f49c8acf4c9412cb8210ad0bce1;p=civicrm-core.git SettingsManager - Use PSR-16 compliant cache key --- diff --git a/Civi/Core/SettingsManager.php b/Civi/Core/SettingsManager.php index 8147afca98..e56d723b2f 100644 --- a/Civi/Core/SettingsManager.php +++ b/Civi/Core/SettingsManager.php @@ -205,7 +205,7 @@ class SettingsManager { return self::getSystemDefaults($entity); } - $cacheKey = 'defaults:' . $entity; + $cacheKey = 'defaults_' . $entity; $defaults = $this->cache->get($cacheKey); if (!is_array($defaults)) { $specs = SettingsMetadata::getMetadata(array( diff --git a/tests/phpunit/Civi/Core/SettingsManagerTest.php b/tests/phpunit/Civi/Core/SettingsManagerTest.php index f4c305665c..ef11330a84 100644 --- a/tests/phpunit/Civi/Core/SettingsManagerTest.php +++ b/tests/phpunit/Civi/Core/SettingsManagerTest.php @@ -132,8 +132,8 @@ class SettingsManagerTest extends \CiviUnitTestCase { */ protected function createManager() { $cache = new \CRM_Utils_Cache_Arraycache(array()); - $cache->set('defaults:domain', $this->domainDefaults); - $cache->set('defaults:contact', $this->contactDefaults); + $cache->set('defaults_domain', $this->domainDefaults); + $cache->set('defaults_contact', $this->contactDefaults); foreach ($this->mandates as $entity => $keyValues) { foreach ($keyValues as $k => $v) { $GLOBALS['civicrm_setting'][$entity][$k] = $v;