10 defined(
'JPATH_PLATFORM') or die;
29 public function __construct($options = array())
31 parent::__construct($options);
45 public function get($id, $group, $checkTime =
true)
47 $cache_id = $this->_getCacheId($id, $group);
48 $cache_content = wincache_ucache_get($cache_id);
49 return $cache_content;
59 public function getAll()
63 $allinfo = wincache_ucache_info();
64 $keys = $allinfo[
'cache_entries'];
65 $secret = $this->_hash;
68 foreach ($keys as $key)
70 $name = $key[
'key_name'];
71 $namearr = explode(
'-', $name);
72 if ($namearr !==
false && $namearr[0] == $secret && $namearr[1] ==
'cache')
75 if (!isset($data[$group]))
81 $item = $data[$group];
83 if (isset($key[
'value_size']))
85 $item->updateSize($key[
'value_size'] / 1024);
92 $data[$group] = $item;
110 public function store($id, $group, $data)
112 $cache_id = $this->_getCacheId($id, $group);
113 return wincache_ucache_set($cache_id, $data, $this->_lifetime);
126 public function remove($id, $group)
128 $cache_id = $this->_getCacheId($id, $group);
129 return wincache_ucache_delete($cache_id);
144 public function clean($group, $mode = null)
146 $allinfo = wincache_ucache_info();
147 $keys = $allinfo[
'cache_entries'];
148 $secret = $this->_hash;
150 foreach ($keys as $key)
152 if (strpos($key[
'key_name'], $secret .
'-cache-' . $group .
'-') === 0 xor $mode !=
'group')
154 wincache_ucache_delete($key[
'key_name']);
169 $allinfo = wincache_ucache_info();
170 $keys = $allinfo[
'cache_entries'];
171 $secret = $this->_hash;
173 foreach ($keys as $key)
175 if (strpos($key[
'key_name'], $secret .
'-cache-'))
177 wincache_ucache_get($key[
'key_name']);
189 public static function isSupported()
191 $test = extension_loaded(
'wincache') && function_exists(
'wincache_ucache_get') && !strcmp(ini_get(
'wincache.ucenabled'),
'1');