log sets and deletes in CACHE_DEBUG mode

This commit is contained in:
Shish 2014-12-06 23:50:56 +00:00
parent 4d6e6ade1c
commit 5ab8f9e5e2

View file

@ -318,6 +318,9 @@ class MemcacheCache implements CacheEngine {
public function set($key, $val, $time=0) { public function set($key, $val, $time=0) {
assert(!is_null($key)); assert(!is_null($key));
$this->memcache->set($key, $val, false, $time); $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) { public function delete($key) {
assert(!is_null($key)); assert(!is_null($key));
$this->memcache->delete($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);
}
} }
/** /**