From 5ab8f9e5e2837279cc94300854583a42d33feffc Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 6 Dec 2014 23:50:56 +0000 Subject: [PATCH] log sets and deletes in CACHE_DEBUG mode --- core/database.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/database.class.php b/core/database.class.php index da68d598..4c025839 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -318,6 +318,9 @@ class MemcacheCache implements CacheEngine { public function set($key, $val, $time=0) { assert(!is_null($key)); $this->memcache->set($key, $val, false, $time); + if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) { + file_put_contents("data/cache.log", "Cache set: $key ($time)\n", FILE_APPEND); + } } /** @@ -326,6 +329,9 @@ class MemcacheCache implements CacheEngine { public function delete($key) { assert(!is_null($key)); $this->memcache->delete($key); + if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) { + file_put_contents("data/cache.log", "Cache delete: $key\n", FILE_APPEND); + } } /**