diff options
author | Evan Prodromou <evan@status.net> | 2010-01-02 20:32:56 -1000 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-02 20:32:56 -1000 |
commit | e1de1bf0fef4c7ae21ebca99dc4f38746c9d2df2 (patch) | |
tree | 630f5ba02dbace8c0647917bc24ca662586d16fc /lib/cache.php | |
parent | c5d23e27a6a34e02090ebcece60dfa5b7f814488 (diff) |
fix default array implementation checks
Diffstat (limited to 'lib/cache.php')
-rw-r--r-- | lib/cache.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/cache.php b/lib/cache.php index d1ba65dab..31d2f84d2 100644 --- a/lib/cache.php +++ b/lib/cache.php @@ -71,9 +71,9 @@ class Cache $value = null; if (!Event::handle('StartCacheGet', array(&$key, &$value))) { - if (array_key_exists($_items, $key)) { + if (array_key_exists($key, $this->_items)) { common_log(LOG_INFO, 'Cache HIT for key ' . $key); - $value = $_items[$key]; + $value = $this->_items[$key]; } else { common_log(LOG_INFO, 'Cache MISS for key ' . $key); } @@ -89,7 +89,7 @@ class Cache if (!Event::handle('StartCacheSet', array(&$key, &$value, &$flag, &$expiry, &$success))) { common_log(LOG_INFO, 'Setting cache value for key ' . $key); - $_items[$key] = $value; + $this->_items[$key] = $value; $success = true; Event::handle('EndCacheSet', array($key, $value, $flag, $expiry)); } @@ -102,8 +102,10 @@ class Cache $success = false; if (!Event::handle('StartCacheDelete', array(&$key, &$success))) { - common_log(LOG_INFO, 'Deleting cache value for key ' . $key); - unset($_items[$key]); + if (array_key_exists($key, $this->_items[$key])) { + common_log(LOG_INFO, 'Deleting cache value for key ' . $key); + unset($this->_items[$key]); + } $success = true; Event::handle('EndCacheDelete', array($key)); } |