summaryrefslogtreecommitdiff
path: root/it_cache.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_cache.class')
-rw-r--r--it_cache.class13
1 files changed, 10 insertions, 3 deletions
diff --git a/it_cache.class b/it_cache.class
index 58277ae..df548b8 100644
--- a/it_cache.class
+++ b/it_cache.class
@@ -48,10 +48,17 @@ static function get($key, $p = array())
{
$p = it_cache::_defaults($p);
- if ($result = $GLOBALS['it_cache_local'][$key])
- ; # Use local copy
+ if (isset($GLOBALS['it_cache_local'][$key]))
+ {
+ # Use local copy
+ $result = $GLOBALS['it_cache_local'][$key];
+ $success = true;
+ }
else if ($p['distributed'] && ($memcache = it_cache::_get_memcache($p)))
- $result = $success = @$memcache->get($key);
+ {
+ $result = @$memcache->get($key);
+ $success = !$memcache->getResultCode();
+ }
else
$result = ($func = self::$_fetch_func) ? $func($key, $success) : null;