From 4b8d896cb03f065004373c9a8540ca97ffb084d1 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 11 Jan 2016 15:07:57 +0100 Subject: Re-add fix to distinguish between false and error when getting values from Memcached --- it_cache.class | 13 ++++++++++--- 1 file 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; -- cgit v1.2.3