summaryrefslogtreecommitdiff
path: root/plugins/CacheLogPlugin.php
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-01-05 01:16:48 +0000
committerSarven Capadisli <csarven@status.net>2010-01-05 01:16:48 +0000
commit48289e607bf207b40201075be8b599c0f3fa597e (patch)
treed310e7091467460905287bc29b33098cf986a906 /plugins/CacheLogPlugin.php
parenteb9514120a882aacae38f8b85a1f431852b44b89 (diff)
parent440b9957f9ae6fdfdb44c39074803fcdbc64112d (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'plugins/CacheLogPlugin.php')
-rw-r--r--plugins/CacheLogPlugin.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/plugins/CacheLogPlugin.php b/plugins/CacheLogPlugin.php
index 9eb04641e..f1e5dd83a 100644
--- a/plugins/CacheLogPlugin.php
+++ b/plugins/CacheLogPlugin.php
@@ -61,7 +61,7 @@ class CacheLogPlugin extends Plugin
function onEndCacheGet($key, &$value)
{
- if (is_null($value)) {
+ if ($value === false) {
$this->log(LOG_INFO, "Cache MISS for key '$key'");
} else {
$this->log(LOG_INFO, "Cache HIT for key '$key'");
@@ -71,7 +71,21 @@ class CacheLogPlugin extends Plugin
function onStartCacheSet(&$key, &$value, &$flag, &$expiry, &$success)
{
- $this->log(LOG_INFO, "Setting cache value for key '$key'");
+ if (empty($value)) {
+ if (is_array($value)) {
+ $this->log(LOG_INFO, "Setting empty array for key '$key'");
+ } else if (is_null($value)) {
+ $this->log(LOG_INFO, "Setting null value for key '$key'");
+ } else if (is_string($value)) {
+ $this->log(LOG_INFO, "Setting empty string for key '$key'");
+ } else if (is_integer($value)) {
+ $this->log(LOG_INFO, "Setting integer 0 for key '$key'");
+ } else {
+ $this->log(LOG_INFO, "Setting empty value '$value' for key '$key'");
+ }
+ } else {
+ $this->log(LOG_INFO, "Setting non-empty value for key '$key'");
+ }
return true;
}