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:
-rw-r--r--core/Cache/StaticCache.php5
-rw-r--r--core/WidgetsList.php8
2 files changed, 12 insertions, 1 deletions
diff --git a/core/Cache/StaticCache.php b/core/Cache/StaticCache.php
index 2a7c37ffc6..a63c8fd796 100644
--- a/core/Cache/StaticCache.php
+++ b/core/Cache/StaticCache.php
@@ -47,6 +47,11 @@ class StaticCache
return array_key_exists($this->cacheKey, self::$staticCache);
}
+ public function clear()
+ {
+ unset(self::$staticCache[$this->cacheKey]);
+ }
+
public function set($content)
{
self::$staticCache[$this->cacheKey] = $content;
diff --git a/core/WidgetsList.php b/core/WidgetsList.php
index be41740ed8..b18807b74d 100644
--- a/core/WidgetsList.php
+++ b/core/WidgetsList.php
@@ -56,7 +56,7 @@ class WidgetsList extends Singleton
*/
static public function get()
{
- $cache = new PluginAwareStaticCache('WidgetsList');
+ $cache = self::getCacheForCompleteList();
if ($cache->has()) {
return $cache->get();
}
@@ -244,5 +244,11 @@ class WidgetsList extends Singleton
{
self::$widgets = array();
self::$hookCalled = false;
+ self::getCacheForCompleteList()->clear();
+ }
+
+ private static function getCacheForCompleteList()
+ {
+ return new PluginAwareStaticCache('WidgetsList');
}
}