Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-12-17 00:25:51 +0300
committerThomas Steur <thomas.steur@googlemail.com>2014-12-17 00:25:51 +0300
commit1634607051341f6d348404cd4bc478cf2474a259 (patch)
tree8893897d8cdb2b5313a3a2f3f6fac39ce1b56755 /core/Tracker/SettingsStorage.php
parentc0f24c160ab2f573a06146c66fa7fc7bab97a3a7 (diff)
added support for different caching backends such as redis
Diffstat (limited to 'core/Tracker/SettingsStorage.php')
-rw-r--r--core/Tracker/SettingsStorage.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/core/Tracker/SettingsStorage.php b/core/Tracker/SettingsStorage.php
index 2e3ac5e17d..7ffb3de872 100644
--- a/core/Tracker/SettingsStorage.php
+++ b/core/Tracker/SettingsStorage.php
@@ -9,9 +9,9 @@
namespace Piwik\Tracker;
-use Piwik\Cache\PersistentCache;
use Piwik\Settings\Storage;
use Piwik\Tracker;
+use Piwik\Cache as PiwikCache;
/**
* Loads settings from tracker cache instead of database. If not yet present in tracker cache will cache it.
@@ -20,14 +20,15 @@ class SettingsStorage extends Storage
{
protected function loadSettings()
{
+ $cacheId = $this->getOptionKey();
$cache = $this->getCache();
- if ($cache->has()) {
- $settings = $cache->get();
+ if ($cache->contains($cacheId)) {
+ $settings = $cache->fetch($cacheId);
} else {
$settings = parent::loadSettings();
- $cache->set($settings);
+ $cache->save($cacheId, $settings);
}
return $settings;
@@ -41,13 +42,18 @@ class SettingsStorage extends Storage
private function getCache()
{
- return new PersistentCache($this->getOptionKey());
+ return self::buildCache($this->getOptionKey());
}
public static function clearCache()
{
Cache::deleteTrackerCache();
- PersistentCache::_reset();
+ self::buildCache()->flushAll();
+ }
+
+ private static function buildCache()
+ {
+ return PiwikCache::getEagerCache();
}
}