isActive = false; if (DEFINED("MAPBENDER_VARIABLE_CACHE") && MAPBENDER_VARIABLE_CACHE) { if (DEFINED("MAPBENDER_CACHE_TYPE") && MAPBENDER_CACHE_TYPE != "") { $this->cacheType = MAPBENDER_CACHE_TYPE; switch ($this->cacheType) { case 'apc': $this->isActive = true; break; } } } } final public function cachedVariableFetch($key) { switch ($this->cacheType) { case "apc": return apc_fetch($key); break; default: return false; break; } } final public function cachedVariableExists($key) { switch ($this->cacheType) { case "apc": //to allow older versions of apc - e.g. 3.1.3 which is used by debian squeeze if (function_exists('apc_exists')) { return apc_exists($key); } else { return (boolean)apc_fetch($key); } break; default: return false; break; } } final public function cachedVariableAdd($key, $value) { switch ($this->cacheType) { case "apc": return apc_add($key, $value); break; default: return false; break; } } } ?>