本文整理汇总了PHP中output_cache_remove_key函数的典型用法代码示例。如果您正苦于以下问题:PHP output_cache_remove_key函数的具体用法?PHP output_cache_remove_key怎么用?PHP output_cache_remove_key使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了output_cache_remove_key函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clean
/**
* Clean some cache records
*
* Available modes are :
* Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
* Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
* This mode is not supported in this backend
* Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
* ($tags can be an array of strings or a single string)
* This mode is not supported in this backend
* Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not matching one of the given tags
* ($tags can be an array of strings or a single string)
* This mode is not supported in this backend
*
* @param string $mode clean mode
* @param tags array $tags array of tags
* @return boolean true if no problem
*/
public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
if ($mode == Zend_Cache::CLEANING_MODE_MATCHING_TAG) {
$idlist = null;
foreach ($tags as $tag) {
$next_idlist = output_cache_get(self::TAGS_PREFIX . $tag, $this->_directives['lifetime']);
if ($idlist) {
$idlist = array_intersect_assoc($idlist, $next_idlist);
} else {
$idlist = $next_idlist;
}
if (count($idlist) == 0) {
// if ID list is already empty - we may skip checking other IDs
$idlist = null;
break;
}
}
if ($idlist) {
foreach ($idlist as $id) {
output_cache_remove_key($id);
}
}
return true;
}
if ($mode == Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG) {
$this->_log("Zend_Cache_Backend_ZendPlatform::clean() : CLEANING_MODE_NOT_MATCHING_TAG is not supported by the Zend Platform backend");
}
$cache_dir = ini_get('zend_accelerator.output_cache_dir');
if (!$cache_dir) {
return false;
}
$cache_dir .= '/.php_cache_api/';
return $this->_clean($cache_dir, $mode);
}
示例2: remove
/**
* Remove a cache file.
*
* @return void
*/
public function remove()
{
output_cache_remove_key($this->getIdMd5());
return;
}
示例3: __unset
function __unset($key)
{
parent::__unset($key);
output_cache_remove_key($this->_realKey($key));
}
示例4: clean
/**
* Clean some cache records
*
* Available modes are :
* IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
* IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
* This mode is not supported in this backend
* IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
* ($tags can be an array of strings or a single string)
* IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => unsupported
* IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
* ($tags can be an array of strings or a single string)
*
* @param string $mode Clean mode
* @param array $tags Array of tags
* @throws IfwPsn_Vendor_Zend_Cache_Exception
* @return boolean True if no problem
*/
public function clean($mode = IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
switch ($mode) {
case IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_ALL:
case IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_OLD:
$cache_dir = ini_get('zend_accelerator.output_cache_dir');
if (!$cache_dir) {
return false;
}
$cache_dir .= '/.php_cache_api/';
return $this->_clean($cache_dir, $mode);
break;
case IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_MATCHING_TAG:
$idlist = null;
foreach ($tags as $tag) {
$next_idlist = output_cache_get(self::TAGS_PREFIX . $tag, $this->_directives['lifetime']);
if ($idlist) {
$idlist = array_intersect_assoc($idlist, $next_idlist);
} else {
$idlist = $next_idlist;
}
if (count($idlist) == 0) {
// if ID list is already empty - we may skip checking other IDs
$idlist = null;
break;
}
}
if ($idlist) {
foreach ($idlist as $id) {
output_cache_remove_key($id);
}
}
return true;
break;
case IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
$this->_log("IfwPsn_Vendor_Zend_Cache_Backend_ZendPlatform::clean() : CLEANING_MODE_NOT_MATCHING_TAG is not supported by the Zend Platform backend");
return false;
break;
case IfwPsn_Vendor_Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
$idlist = null;
foreach ($tags as $tag) {
$next_idlist = output_cache_get(self::TAGS_PREFIX . $tag, $this->_directives['lifetime']);
if ($idlist) {
$idlist = array_merge_recursive($idlist, $next_idlist);
} else {
$idlist = $next_idlist;
}
if (count($idlist) == 0) {
// if ID list is already empty - we may skip checking other IDs
$idlist = null;
break;
}
}
if ($idlist) {
foreach ($idlist as $id) {
output_cache_remove_key($id);
}
}
return true;
break;
default:
IfwPsn_Vendor_Zend_Cache::throwException('Invalid mode for clean() method');
break;
}
}
示例5: clean
/**
* Clean some cache records
*
* Available modes are :
* Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
* Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
* This mode is not supported in this backend
* Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
* ($tags can be an array of strings or a single string)
* This mode is not supported in this backend
* Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not matching one of the given tags
* ($tags can be an array of strings or a single string)
* This mode is not supported in this backend
*
* @param string $mode clean mode
* @param tags array $tags array of tags
* @return boolean true if no problem
*/
public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
{
if ($mode == Zend_Cache::CLEANING_MODE_MATCHING_TAG) {
foreach ($tags as $tag) {
$idlist = output_cache_get(self::TAGS_PREFIX . $tag);
if ($idlist) {
foreach ($idlist as $id) {
output_cache_remove_key($id);
}
}
}
return true;
}
if ($mode == Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG) {
if ($this->_directives['logging']) {
Zend_Log::log("Zend_Cache_Backend_ZendPlatform::clean() : CLEANING_MODE_NOT_MATCHING_TAG is not supported by the Zend Platform backend", Zend_Log::LEVEL_WARNING);
}
}
$cacheDir = ini_get('zend_accelerator.output_cache_dir');
if (!$cacheDir) {
return false;
}
$cacheDir .= '/.php_cache_api/';
return $this->_clean($cacheDir, $mode);
}
示例6: sugar_cache_clear
/**
* Clear a key from the cache. This is used to invalidate a single key.
*
* @param String $key -- Key from global namespace
*/
function sugar_cache_clear($key)
{
unset($GLOBALS['cache_local_store'][$key]);
if ($GLOBALS['external_cache_enabled']) {
$external_key = $GLOBALS['sugar_config']['unique_key'] . $key;
if ($GLOBALS['external_cache_type'] == 'zend') {
output_cache_remove_key($external_key);
} elseif ($GLOBALS['external_cache_type'] == 'apc') {
apc_delete($external_key);
}
}
}