示例#1
0
文件: Redis.php 项目: itkg/core
 /**
  * Remove a value from cache
  *
  * @param \Itkg\Core\CacheableInterface $item
  * @return void
  */
 public function remove(CacheableInterface $item)
 {
     $this->getConnection()->delete($item->getHashKey());
 }
示例#2
0
文件: FileSystem.php 项目: itkg/core
 /**
  * Remove a value from cache
  *
  * @param \Itkg\Core\CacheableInterface $item
  *
  * @return void
  *
  * @throws \RuntimeException
  */
 public function remove(CacheableInterface $item)
 {
     $targetFile = $this->getTargetFile($item->getHashKey());
     if (file_exists($targetFile) && !unlink($targetFile)) {
         throw new \RuntimeException(sprintf('Unable to delete %s cache file', $targetFile));
     }
 }
示例#3
0
文件: Registry.php 项目: itkg/core
 /**
  * Remove a value from cache
  *
  * @param \Itkg\Core\CacheableInterface $item
  * @return void
  */
 public function remove(CacheableInterface $item)
 {
     if (isset($this->values[$item->getHashKey()])) {
         unset($this->values[$item->getHashKey()]);
     }
 }
示例#4
0
文件: Doctrine.php 项目: itkg/core
 /**
  * Remove a value from cache
  *
  * @param \Itkg\Core\CacheableInterface $item
  *
  * @return void
  */
 public function remove(CacheableInterface $item)
 {
     $this->provider->delete($item->getHashKey());
 }