/** * {@inheritdoc} */ public function clear($cacheDir) { if (!$this->cache instanceof ClearableCache) { return; } $this->cache->deleteAll(); }
/** * {@inheritdoc} */ public function deleteAll() { if ($this->cache instanceof ClearableCache) { return $this->cache->deleteAll(); } return false; }
/** * Clears all cache entries. * * @throws \RuntimeException If the cache instance is not an instanceof Doctrine\Common\Cache\ClearableCache */ public function deleteAll() { if ($this->cache instanceof ClearableCache) { $this->cache->deleteAll(); return; } throw new \RuntimeException('Cache given is not an instanceof Doctrine\\Common\\Cache\\ClearableCache'); }
/** * {@inheritdoc} */ public function evictAll() { if (!$this->cache instanceof ClearableCache) { throw new \BadMethodCallException(sprintf('Clearing all cache entries is not supported by the supplied cache adapter of type %s', get_class($this->cache))); } return $this->cache->deleteAll(); }
/** * {@inheritdoc} */ public function clear() { $this->store->clear(); if ($this->cache instanceof ClearableCache) { $this->cache->deleteAll(); } else { $this->cache->flushAll(); } }
/** * Purge the advanced asset cache. * * @return void * * @SuppressWarnings(PHPMD.Superglobals) */ public function purgeAdvancedAssetCache() { if ($this->cache instanceof CacheProvider) { $this->cache->deleteAll(); } else { $_SESSION['CLEAR_CACHE_CONFIRM'] = $GLOBALS['TL_LANG']['tl_maintenance_jobs']['theme_plus_aac'][2]; \Controller::reload(); } }
protected function buildCache(\TwigBackendTemplate $template, Cache $cache, \Session $session) { // clear the existing caches /** @var \Automator $automator */ $automator = \System::importStatic('Automator'); $automator->purgeScriptCache(); if ($cache instanceof CacheProvider) { $cache->deleteAll(); } // overwrite frontend username $template->frontendUsername = \Input::post('user'); $session->set(self::SESSION_LAST_USERNAME, $template->frontendUsername); // Use searchable pages to generate assets // TODO this seems to be not a good idea... // $GLOBALS['TL_CONFIG']['indexProtected'] = true; // $template->urls = \Backend::findSearchablePages(0, '', true); list($guestUrls, $memberUrls) = $this->buildPageUrls(0, \Environment::get('base') . '/'); $template->guestUrls = $guestUrls; $template->memberUrls = $memberUrls; $cache->save(ThemePlus::CACHE_CREATION_TIME, time()); }
/** * Initializes dynamic translation resources * * @param string $locale */ protected function initializeDynamicResources($locale) { $this->ensureDynamicResourcesLoaded($locale); // check if any dynamic resource is changed and update translation catalogue if needed if (!empty($this->dynamicResources[$locale])) { $catalogueFile = $this->options['cache_dir'] . '/catalogue.' . $locale . '.' . sha1(serialize($this->getFallbackLocales())) . '.php'; if (is_file($catalogueFile)) { $time = filemtime($catalogueFile); foreach ($this->dynamicResources[$locale] as $item) { /** @var DynamicResourceInterface $dynamicResource */ $dynamicResource = $item['resource']; if (!$dynamicResource->isFresh($time)) { // remove translation catalogue to allow parent class to rebuild it unlink($catalogueFile); // make sure that translations will be loaded from source resources if ($this->resourceCache instanceof ClearableCache) { $this->resourceCache->deleteAll(); } break; } } } } }
/** * Delete (clear) all the currently cached metadata. */ public function clearAll() { if ($this->cache instanceof ClearableCache) { $this->cache->deleteAll(); } }
/** * delete all cache entries. * * @return boolean */ public function deleteAll() { return $this->CacheDriver->deleteAll(); }
protected function deleteDoctrineCache(\Doctrine\Common\Cache\Cache $cacheDriver) { $cacheDriver->deleteAll(); $cacheDriver->flushAll(); }
public static function setUpBeforeClass() { self::$cache = new PhpFileCache(sys_get_temp_dir() . '/lcn_weather_forecast'); self::$cache->deleteAll(); }
/** * Clear all the entries stored by this storage. */ public function clear() { $this->driver->deleteAll(); }