27 #require_once 'Zend/Cache/Backend/ExtendedInterface.php'; 32 #require_once 'Zend/Cache/Backend.php'; 58 if (!extension_loaded(
'wincache')) {
73 public function load(
$id, $doNotTestCacheValidity =
false)
75 $tmp = wincache_ucache_get(
$id);
90 $tmp = wincache_ucache_get(
$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_WINCACHE_BACKEND);
125 public function remove(
$id)
127 return wincache_ucache_delete(
$id);
149 return wincache_ucache_clear();
152 $this->
_log(
"Zend_Cache_Backend_WinCache::clean() : CLEANING_MODE_OLD is unsupported by the WinCache backend");
157 $this->
_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_WINCACHE_BACKEND);
186 $mem = wincache_ucache_meminfo();
187 $memSize = $mem[
'memory_total'];
188 $memUsed = $memSize - $mem[
'memory_free'];
192 if ($memUsed > $memSize) {
195 return ((
int) (100. * ($memUsed / $memSize)));
205 $this->
_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
219 $this->
_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
233 $this->
_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
247 $this->
_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
259 $array = wincache_ucache_info();
260 $records = $array[
'ucache_entries'];
261 foreach ($records as $record) {
262 $res[] = $record[
'key_name'];
280 $tmp = wincache_ucache_get(
$id);
281 if (is_array($tmp)) {
284 if (!isset($tmp[2])) {
289 'expire' => $mtime + $lifetime,
306 $tmp = wincache_ucache_get(
$id);
307 if (is_array($tmp)) {
310 if (!isset($tmp[2])) {
314 $newLifetime = $lifetime - (
time() - $mtime) + $extraLifetime;
315 if ($newLifetime <=0) {
318 return wincache_ucache_set(
$id, array(
$data,
time(), $newLifetime), $newLifetime);
340 'automatic_cleaning' =>
false,
342 'expired_read' =>
false,
344 'infinite_lifetime' =>
false,
isAutomaticCleaningAvailable()
getIdsMatchingAnyTags($tags=array())
getIdsNotMatchingTags($tags=array())
getIdsMatchingTags($tags=array())
_log($message, $priority=4)
__construct(array $options=array())
const CLEANING_MODE_NOT_MATCHING_TAG
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
clean($mode=Zend_Cache::CLEANING_MODE_ALL, $tags=array())
static throwException($msg, Exception $e=null)
const TAGS_UNSUPPORTED_BY_CLEAN_OF_WINCACHE_BACKEND
const CLEANING_MODE_MATCHING_ANY_TAG
save($data, $id, $tags=array(), $specificLifetime=false)
const CLEANING_MODE_MATCHING_TAG
const TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND
getLifetime($specificLifetime)
load($id, $doNotTestCacheValidity=false)
touch($id, $extraLifetime)