summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2010-01-17 14:37:47 +0000
committerChristian Schneider2010-01-17 14:37:47 +0000
commit1a186a1f35b7fb83cd482c9b0183ad985766afa5 (patch)
tree7e33d91a6bb90e5970ed08bf246dd9865b5ef063
parent49ab97ee76d902b7855e1bac37186a902d5093fb (diff)
downloaditools-1a186a1f35b7fb83cd482c9b0183ad985766afa5.tar.gz
itools-1a186a1f35b7fb83cd482c9b0183ad985766afa5.tar.bz2
itools-1a186a1f35b7fb83cd482c9b0183ad985766afa5.zip
Add support for APC (replaces EAccelerator for PHP 5.3)
-rw-r--r--it_cache.class4
1 files 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