summaryrefslogtreecommitdiff
path: root/it_cache.class
diff options
context:
space:
mode:
authorChristian Schneider2016-01-11 15:07:57 +0100
committerChristian Schneider2016-01-11 15:07:57 +0100
commit4b8d896cb03f065004373c9a8540ca97ffb084d1 (patch)
tree3cecb971898fd58bc9961eb794812e9c5e975a54 /it_cache.class
parentf7abbe808fcbe761f869e116e499f0e8fe8d631b (diff)
downloaditools-4b8d896cb03f065004373c9a8540ca97ffb084d1.tar.gz
itools-4b8d896cb03f065004373c9a8540ca97ffb084d1.tar.bz2
itools-4b8d896cb03f065004373c9a8540ca97ffb084d1.zip
Re-add fix to distinguish between false and error when getting values from Memcached
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;