12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace Doctrine\Common\Cache;
- class WinCacheCache extends CacheProvider
- {
-
- protected function doFetch($id)
- {
- return wincache_ucache_get($id);
- }
-
- protected function doContains($id)
- {
- return wincache_ucache_exists($id);
- }
-
- protected function doSave($id, $data, $lifeTime = 0)
- {
- return (bool) wincache_ucache_set($id, $data, (int) $lifeTime);
- }
-
- protected function doDelete($id)
- {
- return wincache_ucache_delete($id);
- }
-
- protected function doFlush()
- {
- return wincache_ucache_clear();
- }
-
- protected function doGetStats()
- {
- $info = wincache_ucache_info();
- $meminfo = wincache_ucache_meminfo();
- return array(
- Cache::STATS_HITS => $info['total_hit_count'],
- Cache::STATS_MISSES => $info['total_miss_count'],
- Cache::STATS_UPTIME => $info['total_cache_uptime'],
- Cache::STATS_MEMORY_USAGE => $meminfo['memory_total'],
- Cache::STATS_MEMORY_AVAILABLE => $meminfo['memory_free'],
- );
- }
- }
|