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:
Diffstat (limited to 'core/Cache/PersistentCache.php')
-rw-r--r--core/Cache/PersistentCache.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/core/Cache/PersistentCache.php b/core/Cache/PersistentCache.php
index 3bb74fd2b1..5a98621a4c 100644
--- a/core/Cache/PersistentCache.php
+++ b/core/Cache/PersistentCache.php
@@ -12,6 +12,7 @@ use Piwik\CacheFile;
use Piwik\Development;
use Piwik\Piwik;
use Piwik\SettingsServer;
+use Piwik\Version;
/**
* Caching class that persists all cached values between requests. Meaning whatever you cache will be stored on the
@@ -97,13 +98,13 @@ class PersistentCache
if (SettingsServer::isTrackerApiRequest()) {
$eventToPersist = 'Tracker.end';
- $mode = 'tracker';
+ $mode = '-tracker';
} else {
$eventToPersist = 'Request.dispatch.end';
- $mode = 'ui';
+ $mode = '-ui';
}
- $cache = self::getStorage()->get('StaticCache-' . $mode);
+ $cache = self::getStorage()->get(self::getCacheFilename() . $mode);
if (is_array($cache)) {
self::$content = $cache;
@@ -112,6 +113,11 @@ class PersistentCache
Piwik::addAction($eventToPersist, array(__CLASS__, 'persistCache'));
}
+ private static function getCacheFilename()
+ {
+ return 'StaticCache-' . str_replace(array('.', '-'), '', Version::VERSION);
+ }
+
/**
* @ignore
*/
@@ -119,12 +125,12 @@ class PersistentCache
{
if (self::$isDirty) {
if (SettingsServer::isTrackerApiRequest()) {
- $mode = 'tracker';
+ $mode = '-tracker';
} else {
- $mode = 'ui';
+ $mode = '-ui';
}
- self::getStorage()->set('StaticCache-' . $mode, self::$content);
+ self::getStorage()->set(self::getCacheFilename() . $mode, self::$content);
}
}