本文整理汇总了PHP中Zend_Cache::clean方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Cache::clean方法的具体用法?PHP Zend_Cache::clean怎么用?PHP Zend_Cache::clean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Cache
的用法示例。
在下文中一共展示了Zend_Cache::clean方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearModuleCache
/**
* Clears the cache entry for a specific module or all modules.
*
* @param string|null $moduleName If null, all cache for all modules is cleared.
*
* @return bool
*/
public function clearModuleCache($moduleName = null)
{
if ($this->_moduleCache) {
if (null !== $moduleName) {
return $this->_moduleCache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('module', $moduleName));
}
return $this->_moduleCache->clean(Zend_Cache::CLEANING_MODE_ALL);
}
}
示例2: clean
/**
* Clean all cache entries
*
* @return boolean
* @throws coding_exception
*/
public function clean()
{
if ($this->cache === false) {
return true;
}
try {
return $this->cache->clean();
} catch (Zend_Cache_Exception $e) {
throw new coding_exception('Zend Cache Error: ' . $e->getMessage());
}
}
示例3: delete
/**
* Delete a queue and all of it's messages
*
* @param string $name queue name
* @return boolean True
*/
public function delete($name)
{
$queues = $this->_cache->load(self::DEFAULT_QUEUE_KEY);
if (is_array($queues)) {
foreach ($queues as $key => &$queue) {
if ($queue['name'] == $name) {
unset($queues[$key]);
break;
}
}
}
// Delete any messages in the queue
$this->_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array($name));
return $this->_cache->save($queues, self::DEFAULT_QUEUE_KEY, array(), 0);
}
示例4: cleanAllCachesAction
/**
* Metodo que faz limpeza do Cache (Memcached ou Filesystem)
* das duas instancias de cache do MPE: cache_FS e cache_acl
*
* Como chamar via admim:
*
* http://[mpe-dominio]/cache/clean-all-caches
*
* @author esilva
*
* @param Zend_Cache $cache
*/
public function cleanAllCachesAction(Zend_Cache $cache = null)
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$this->cache = Zend_Registry::get('cache_FS');
$this->cache2 = Zend_Registry::get('cache_acl');
echo "<br>Inserindo conteudo no Cache (Memcached ou Filesystem) <br><br>";
$this->cache->save('conteudo variavel teste eh este!!', 'teste');
$testando = $this->cache->load('teste');
$this->cache2->save('conteudo variavel testeAcl eh este!!', 'testeAcl');
$testandoAcl = $this->cache2->load('testeAcl');
sleep(1);
echo "";
var_dump('teste_var (cache): ', $testando);
var_dump('teste_var_acl (cache): ', $testandoAcl);
echo "<br><BR>LIMPANDO CACHE!!!<br><BR>";
// clean all records
$this->cache->clean(Zend_Cache::CLEANING_MODE_ALL);
$this->cache2->clean(Zend_Cache::CLEANING_MODE_ALL);
// clean only outdated
$this->cache->clean(Zend_Cache::CLEANING_MODE_OLD);
$this->cache2->clean(Zend_Cache::CLEANING_MODE_OLD);
sleep(2);
echo "<br> [Verificação da limpeza do cache]<Br><BR>";
$testando = $this->cache->load('teste');
$testando2 = $this->cache->load('teste2');
$testando3 = $this->cache->load('teste3');
$testandoAcl = $this->cache2->load('testeAcl');
//recupera do cache
if ($testando == false) {
echo "variavel [teste] não mais existe<br>";
echo "variavel [teste2] não mais existe<br>";
echo "variavel [teste3] não mais existe<br>";
echo "variavel [testeAcl] não mais existe<br>";
} else {
echo "variavel [teste] existe no cache: ";
echo "teste: " . $testando . "<br>";
echo "variavel [teste2] existe no cache: ";
echo "teste2: " . $testando2 . "<br>";
echo "variavel [teste3] existe no cache: ";
echo "teste3: " . $testando3 . "<br>";
echo "variavel [testeAcl] existe no cache: ";
echo "testeAcl: " . $testandoAcl . "<br>";
}
}
示例5: clean
/**
* method to clean all cache tier
*
* @return mixed the value in the cache
*/
public function clean()
{
return $this->cache->clean();
}
示例6: refreshCache
/**
* Refresh Cache
*
* Clears all cached information for SimpleDb and refreshes items
* that will not refresh themselves.
*
* @param void
* @return void
*/
public function refreshCache()
{
$this->_cache->clean(Zend_Cache::CLEANING_MODE_ALL);
$this->_loadTableNames();
$this->_tableInfo = array();
}