gizmore/gdo6

Undefined function Cache::cooldown() in /GDO/DB/Cache.php

flederohr opened this issue · 1 comments

When enabling the option GWF_MEMCACHE in the config.php following exception is thrown when clearing the cache:

PHP Exception: Call to undefined method GDO/DB/Cache::cooldown() in GDO/DB/Cache.php line 46
Backtrace starts in index.php line 80.
GDO\Core\Method->exec() .................. GDO/Core/Method.php line 375.
GDO\Core\Method->execWrap() .............. GDO/Core/Method.php line 398.
GDO\Core\Method->executeWithInit() ....... GDO/Core/Method.php line 437.
GDO\Admin\Method\ClearCache->execute() ... GDO/Admin/Method/ClearCache.php line 35.
GDO\Admin\Method\ClearCache->clearCache() GDO/Admin/Method/ClearCache.php line 42.
GDO\DB\Cache::flush() .................... GDO/DB/Cache.php line 46.

Changing the file and removing the call of the undefined Cache::cooldown() seems to fix the issue.

diff --git a/GDO/DB/Cache.php b/GDO/DB/Cache.php
index 1642215..d89c5c0 100644
--- a/GDO/DB/Cache.php
+++ b/GDO/DB/Cache.php
@@ -43,7 +43,7 @@ class Cache
        public static function get($key) { return GWF_MEMCACHE ? self::$MEMCACHED->get(GWF_MEMCACHE_PREFIX.$key) : false; }
        public static function set($key, $value) { if (GWF_MEMCACHE) self::$MEMCACHED->set(GWF_MEMCACHE_PREFIX.$key, $value); }
        public static function remove($key) { if (GWF_MEMCACHE) self::$MEMCACHED->delete(GWF_MEMCACHE_PREFIX.$key); }
-       public static function flush() { if (GWF_MEMCACHE) { self::$MEMCACHED->flush(); Cache::cooldown(); } }
+       public static function flush() { if (GWF_MEMCACHE) { self::$MEMCACHED->flush(); } }
        public static function init()
        {
                if (GWF_MEMCACHE)

Fixed with r1044.

FYI: i once played with a cache preheat to pre-fill the cache with most often used items... totally idiotic and pointless :) Cache just works on demand.