From 12eaada5ba3b0f49c8acf4c9412cb8210ad0bce1 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 20 Jun 2018 22:40:06 -0700 Subject: [PATCH] SettingsManager - Use PSR-16 compliant cache key --- Civi/Core/SettingsManager.php | 2 +- tests/phpunit/Civi/Core/SettingsManagerTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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; -- 2.25.1