summaryrefslogtreecommitdiff
path: root/inc/cache.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-28 20:34:06 -0400
committerczaks <marcin@6irc.net>2013-08-28 20:34:06 -0400
commitb95840adcb9c5d76952a7e13a9ac3ac190948f03 (patch)
tree1ffc0e541564d7c200ab31146a0366c68ce0b4cb /inc/cache.php
parenta1d9de205bbfc4be2385dad5bf16e4478b62f236 (diff)
parent90eb8f1f3765afc848f7a3f7f12d83a46fe9e92f (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: inc/functions.php
Diffstat (limited to 'inc/cache.php')
-rw-r--r--inc/cache.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/inc/cache.php b/inc/cache.php
index 849748d4..fd89be13 100644
--- a/inc/cache.php
+++ b/inc/cache.php
@@ -60,10 +60,8 @@ class Cache {
break;
}
- // debug
- if ($data !== false && $config['debug']) {
- $debug['cached'][] = $key;
- }
+ if ($config['debug'])
+ $debug['cached'][] = $key . ($data === false ? ' (miss)' : ' (hit)');
return $data;
}
@@ -95,10 +93,13 @@ class Cache {
case 'php':
self::$cache[$key] = $value;
break;
- }
+ }
+
+ if ($config['debug'])
+ $debug['cached'][] = $key . ' (set)';
}
public static function delete($key) {
- global $config;
+ global $config, $debug;
$key = $config['cache']['prefix'] . $key;
@@ -119,6 +120,9 @@ class Cache {
unset(self::$cache[$key]);
break;
}
+
+ if ($config['debug'])
+ $debug['cached'][] = $key . ' (deleted)';
}
public static function flush() {
global $config;