From 1a186a1f35b7fb83cd482c9b0183ad985766afa5 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Sun, 17 Jan 2010 14:37:47 +0000 Subject: Add support for APC (replaces EAccelerator for PHP 5.3) --- it_cache.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/it_cache.class b/it_cache.class index bcd9bd3..20e3f43 100644 --- a/it_cache.class +++ b/it_cache.class @@ -52,7 +52,7 @@ static function get($key, $p = array()) else if ($p['distributed'] && ($memcache = it_cache::_get_memcache($p))) $result = @$memcache->get($key); else - $result = function_exists("eaccelerator_get") ? eaccelerator_get($key) : null; + $result = function_exists("apc_fetch") ? apc_fetch($key) : (function_exists("eaccelerator_get") ? eaccelerator_get($key) : null); return $result; } @@ -75,7 +75,7 @@ static function put($key, $value, $p = array()) else { function_exists("eaccelerator_gc") && eaccelerator_gc(); - $result = function_exists("eaccelerator_put") ? eaccelerator_put($key, $value, $p['ttl']) : null; + $result = function_exists("apc_store") ? apc_store($key, $value, $p['ttl']) : (function_exists("eaccelerator_put") ? eaccelerator_put($key, $value, $p['ttl']) : null); } $GLOBALS['it_cache_local'][$key] = $value; # Also store local copy -- cgit v1.2.3