From c3ac61c52780b91653efeeb88eb90739ee0a7b31 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Tue, 10 May 2016 16:21:32 +0200 Subject: Adapt ITools to Memcached extension (used with PHP 7) --- it_cache.class | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'it_cache.class') diff --git a/it_cache.class b/it_cache.class index df548b8..d01df52 100644 --- a/it_cache.class +++ b/it_cache.class @@ -78,7 +78,7 @@ static function put($key, $value, $p = array()) $p = it_cache::_defaults($p); if ($p['distributed'] && ($memcache = it_cache::_get_memcache($p))) - $success = @$memcache->set($key, $value, MEMCACHE_COMPRESSED, $p['ttl']); + $success = @$memcache->set($key, $value, $p['ttl']); else $success = ($func = self::$_store_func) ? $func($key, $value, $p['ttl']) : null; @@ -94,12 +94,12 @@ static function _get_memcache($p) { $memcache_id = "it_cache_memcache_" . $p['hostsfile']; - if (!isset($GLOBALS[$memcache_id]) && class_exists("Memcache", false)) + if (!isset($GLOBALS[$memcache_id]) && class_exists("Memcached", false)) { - $memcache = new Memcache; + $memcache = new Memcached; foreach (array_filter(it::replace(array('[#\s].*' => ""), file($p['hostsfile']))) as $host) - $reachable += intval(@$memcache->addServer($host)); + $reachable += intval(@$memcache->addServer($host, 11211)); $GLOBALS[$memcache_id] = $reachable ? $memcache : false; } -- cgit v1.2.3