From 30886b3a692a9eb1f746d7a8906e3d3dfa81b4a4 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 5 Jul 2013 22:19:12 +0100 Subject: [PATCH] cache lookup debugging --- core/database.class.php | 3 +++ core/sys_config.inc.php | 1 + 2 files changed, 4 insertions(+) diff --git a/core/database.class.php b/core/database.class.php index 1e8da970..97f7c717 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -199,6 +199,9 @@ 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($val !== false) { $this->hits++; diff --git a/core/sys_config.inc.php b/core/sys_config.inc.php index 6473ebc5..4190358f 100644 --- a/core/sys_config.inc.php +++ b/core/sys_config.inc.php @@ -24,6 +24,7 @@ _d("DATABASE_KA", true); // string Keep database connection alive _d("CACHE_DSN", null); // string cache connection details _d("DEBUG", false); // boolean print various debugging details _d("DEBUG_SQL", false); // boolean dump SQL queries to data/sql.log +_d("DEBUG_CACHE", false); // boolean dump cache queries to data/cache.log _d("COVERAGE", false); // boolean activate xdebug coverage monitor _d("CONTEXT", null); // string file to log performance data into _d("CACHE_HTTP", false); // boolean output explicit HTTP caching headers