summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/CacheLogPlugin.php18
-rw-r--r--plugins/XCachePlugin.php6
2 files changed, 20 insertions, 4 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;
}
diff --git a/plugins/XCachePlugin.php b/plugins/XCachePlugin.php
index 8eed12cbc..03cb0c06e 100644
--- a/plugins/XCachePlugin.php
+++ b/plugins/XCachePlugin.php
@@ -63,8 +63,10 @@ class XCachePlugin extends Plugin
function onStartCacheGet(&$key, &$value)
{
- $value = xcache_get($key);
- if (!is_null($value)) {
+ if (!xcache_isset($key)) {
+ $value = false;
+ } else {
+ $value = xcache_get($key);
$value = unserialize($value);
}
Event::handle('EndCacheGet', array($key, &$value));