示例#1
0
 function clear($cid = NULL, $wildcard = FALSE)
 {
     // This function also accepts arrays, thus handle everything like an array.
     $cids = is_array($cid) ? $cid : array($cid);
     foreach ($cids as $cid) {
         $this->backend->clear($cid, $wildcard);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function clearCachedDefinitions()
 {
     if ($this->cacheBackend) {
         $this->cacheBackend->clear($this->cacheKey);
     }
     $this->definitions = NULL;
 }
示例#3
0
 public function gc($lifetime)
 {
     // FIXME: This is not the valid signature we would really want to have,
     // but this doesn't seems that easy to match the real PHP session lifetime
     // API signature with cache backends.
     $this->cacheBackend->clear();
     return TRUE;
 }
 /**
  * {@inheritdoc}
  */
 public function clear()
 {
     // Remove the cache.
     $this->cacheObject->clear($this->generateCacheId());
     // Delete all cache fragments for that hash.
     $query = new \EntityFieldQuery();
     $results = $query->entityCondition('entity_type', 'cache_fragment')->propertyCondition('hash', $this->generateCacheId())->execute();
     if (empty($results['cache_fragment'])) {
         return;
     }
     // Delete the actual entities.
     entity_delete_multiple('cache_fragment', array_keys($results['cache_fragment']));
 }
 /**
  * {inheritdoc}
  */
 public function deleteAll()
 {
     return $this->backend->clear('*', true);
 }
 /**
  * Reset the internal cache.
  *
  * Note: This is just thought for tests.
  */
 public function reset()
 {
     $this->cachedDefinition = NULL;
     $this->cache->clear($this->getCacheId());
 }