58 public function write($key, $value, $ttl = null)
60 $item = $this->
pool->getItem($key);
61 return $item->set($value, $ttl);
73 $item = $this->
pool->getItem($key);
75 return ($item->isMiss()) ?
false : $value;
85 public function delete($key)
87 $item = $this->
pool->getItem($key);
88 return $item->clear();
107 public function cacheRead($cacheKey, $regenFunction, $ttl = null, $args = null)
109 if (is_null($args)) {
112 $varArgs = func_get_args();
113 array_shift($varArgs);
114 array_shift($varArgs);
115 array_shift($varArgs);
118 $item = $this->
pool->getItem($cacheKey);
122 $cachedContent = $item->get(Invalidation::PRECOMPUTE);
125 if ($item->isMiss()) {
130 $cachedContent = call_user_func_array($regenFunction, $varArgs);
133 $item->set($cachedContent, $ttl);
136 return $cachedContent;
146 return $this->
pool->purge();
156 return $this->
pool->flush();
__construct(PoolInterface $pool)
cacheRead($cacheKey, $regenFunction, $ttl=null, $args=null)
write($key, $value, $ttl=null)