diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-07-02 14:09:51 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-07-02 14:09:51 +0400 |
commit | b8373e7e7e672c9f46212680643b0346d78b6e5b (patch) | |
tree | 2230266dc35d1a0acc23f1626fa515fba27d4e04 | |
parent | 286b05c4d5d2cac010b0cd429763112ee7dc61c4 (diff) |
should fix integration tests
-rw-r--r-- | core/Cache/StaticCache.php | 5 | ||||
-rw-r--r-- | core/WidgetsList.php | 8 |
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'); } } |