27 #require_once 'Zend/Cache/Backend/ExtendedInterface.php'; 32 #require_once 'Zend/Cache/Backend.php'; 58 if (!extension_loaded(
'apc')) {
73 public function load(
$id, $doNotTestCacheValidity =
false)
75 $tmp = apc_fetch(
$id);
90 $tmp = apc_fetch(
$id);
109 public function save(
$data,
$id, $tags = array(), $specificLifetime =
false)
113 if (count($tags) > 0) {
114 $this->
_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
125 public function remove(
$id)
127 return apc_delete(
$id);
149 return apc_clear_cache(
'user');
152 $this->
_log(
"Zend_Cache_Backend_Apc::clean() : CLEANING_MODE_OLD is unsupported by the Apc backend");
157 $this->
_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_APC_BACKEND);
186 $mem = apc_sma_info(
true);
187 $memSize = $mem[
'num_seg'] * $mem[
'seg_size'];
188 $memAvailable= $mem[
'avail_mem'];
189 $memUsed = $memSize - $memAvailable;
193 if ($memUsed > $memSize) {
196 return ((
int) (100. * ($memUsed / $memSize)));
206 $this->
_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
220 $this->
_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
234 $this->
_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
248 $this->
_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
260 $iterator =
new APCIterator(
'user',
null, APC_ITER_KEY);
262 $ids[] =
$item[
'key'];
281 $tmp = apc_fetch(
$id);
282 if (is_array($tmp)) {
285 if (!isset($tmp[2])) {
292 'expire' => $mtime + $lifetime,
309 $tmp = apc_fetch(
$id);
310 if (is_array($tmp)) {
313 if (!isset($tmp[2])) {
319 $newLifetime = $lifetime - (
time() - $mtime) + $extraLifetime;
320 if ($newLifetime <=0) {
323 apc_store(
$id, array(
$data,
time(), $newLifetime), $newLifetime);
346 'automatic_cleaning' =>
false,
348 'expired_read' =>
false,
350 'infinite_lifetime' =>
false,
clean($mode=Zend_Cache::CLEANING_MODE_ALL, $tags=array())
load($id, $doNotTestCacheValidity=false)
__construct(array $options=array())
touch($id, $extraLifetime)
_log($message, $priority=4)
getIdsMatchingAnyTags($tags=array())
getIdsMatchingTags($tags=array())
const CLEANING_MODE_NOT_MATCHING_TAG
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
static throwException($msg, Exception $e=null)
const TAGS_UNSUPPORTED_BY_CLEAN_OF_APC_BACKEND
isAutomaticCleaningAvailable()
getIdsNotMatchingTags($tags=array())
const CLEANING_MODE_MATCHING_ANY_TAG
const CLEANING_MODE_MATCHING_TAG
const TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND
getLifetime($specificLifetime)
save($data, $id, $tags=array(), $specificLifetime=false)