本文整理匯總了PHP中Doctrine\Common\Cache\Cache::deleteAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cache::deleteAll方法的具體用法?PHP Cache::deleteAll怎麽用?PHP Cache::deleteAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\Common\Cache\Cache
的用法示例。
在下文中一共展示了Cache::deleteAll方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: clear
/**
* {@inheritdoc}
*/
public function clear($cacheDir)
{
if (!$this->cache instanceof ClearableCache) {
return;
}
$this->cache->deleteAll();
}
示例2: deleteAll
/**
* {@inheritdoc}
*/
public function deleteAll()
{
if ($this->cache instanceof ClearableCache) {
return $this->cache->deleteAll();
}
return false;
}
示例3: deleteAll
/**
* 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');
}
示例4: evictAll
/**
* {@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();
}
示例5: clear
/**
* {@inheritdoc}
*/
public function clear()
{
$this->store->clear();
if ($this->cache instanceof ClearableCache) {
$this->cache->deleteAll();
} else {
$this->cache->flushAll();
}
}
示例6: purgeAdvancedAssetCache
/**
* 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();
}
}
示例7: buildCache
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());
}
示例8: initializeDynamicResources
/**
* 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;
}
}
}
}
}
示例9: clearAll
/**
* Delete (clear) all the currently cached metadata.
*/
public function clearAll()
{
if ($this->cache instanceof ClearableCache) {
$this->cache->deleteAll();
}
}
示例10: deleteAll
/**
* delete all cache entries.
*
* @return boolean
*/
public function deleteAll()
{
return $this->CacheDriver->deleteAll();
}
示例11: deleteDoctrineCache
protected function deleteDoctrineCache(\Doctrine\Common\Cache\Cache $cacheDriver)
{
$cacheDriver->deleteAll();
$cacheDriver->flushAll();
}
示例12: setUpBeforeClass
public static function setUpBeforeClass()
{
self::$cache = new PhpFileCache(sys_get_temp_dir() . '/lcn_weather_forecast');
self::$cache->deleteAll();
}
示例13: clear
/**
* Clear all the entries stored by this storage.
*/
public function clear()
{
$this->driver->deleteAll();
}