From 1c60942730910e59a64b89d623729378466065ed Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 26 Nov 2014 13:07:30 +0000 Subject: [PATCH] log hit/miss when DEBUG_CACHE is on --- core/database.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/database.class.php b/core/database.class.php index 18998dc9..fd9bade2 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -295,10 +295,11 @@ class MemcacheCache implements CacheEngine { */ public function get($key) { assert(!is_null($key)); - if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) { - file_put_contents("data/cache.log", "Cache lookup: $key\n", FILE_APPEND); - } $val = $this->memcache->get($key); + if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) { + $hit = $val === false ? "miss" : "hit"; + file_put_contents("data/cache.log", "Cache $hit: $key\n", FILE_APPEND); + } if($val !== false) { $this->hits++; return $val;