From 50485bf9d9243693514ace67e9931a6c24947333 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Thu, 18 Jan 2018 17:39:52 +0100 Subject: Avoid all $memcache->xy() calls when $memcache is not set --- it_cache.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it_cache.class b/it_cache.class index b2e9a31..ff6dbfa 100644 --- a/it_cache.class +++ b/it_cache.class @@ -86,7 +86,7 @@ static function put($key, $value, $p = array()) $success = ($func = self::$_store_func) ? $func($key, $value, $p['ttl']) : null; if (!$success && $p['safety'] == 1) - it::error(array('title' => ($p['distributed'] ? "memcache (" . ($memcache ? $memcache->getResultMessage() : "") . " on " . $memcache->getServerByKey($key)['host'] . ")" : self::$_store_func) . " in it_cache::put failed for key '$key'", 'id' => "it_cache_put", 'graceperiod' => 300, 'timewindow' => 10)); + it::error(array('title' => ($p['distributed'] ? "memcache (" . ($memcache ? ($memcache->getResultMessage() . " on " . $memcache->getServerByKey($key)['host']) : "n/a") . ")" : self::$_store_func) . " in it_cache::put failed for key '$key'", 'id' => "it_cache_put", 'graceperiod' => 300, 'timewindow' => 10)); $GLOBALS['it_cache_local'][$key] = $value; # Also store local copy -- cgit v1.2.3