本文整理汇总了PHP中xcache_unset_by_prefix函数的典型用法代码示例。如果您正苦于以下问题:PHP xcache_unset_by_prefix函数的具体用法?PHP xcache_unset_by_prefix怎么用?PHP xcache_unset_by_prefix使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xcache_unset_by_prefix函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBackend
public function getBackend()
{
xcache_unset_by_prefix("cache");
$backend = new \Cachet\Backend\XCache();
$backend->setKeyBackend(new \Cachet\Backend\Memory());
return $backend;
}
示例2: deactivate
public static function deactivate()
{
$pluginOpts = Typecho_Widget::widget('Widget_Options')->plugin('TypechoXcache');
if ($pluginOpts->clearCacheAfterDisable == 'true') {
xcache_unset_by_prefix($pluginOpts->{$prefix});
return '缓存清空,成功关闭';
}
return '成功关闭';
}
示例3: clear
public function clear($prefix = '')
{
if (function_exists('xcache_unset_by_prefix')) {
return xcache_unset_by_prefix($this->getNamespace() . $prefix);
} else {
// Since we can not clear by prefix, we just clear the whole cache.
xcache_clear_cache(\XC_TYPE_VAR, 0);
}
return true;
}
示例4: clear
public function clear($prefix = '')
{
if (!function_exists('xcache_unset_by_prefix')) {
function xcache_unset_by_prefix($prefix)
{
// Since we can't clear targetted cache, we'll clear all. :(
xcache_clear_cache(XC_TYPE_VAR, 0);
}
}
xcache_unset_by_prefix($this->getNamespace() . $prefix);
return true;
}
示例5: flush
/**
* Flush the cache.
*/
function flush()
{
$prefix = INDEX_FILE_LOCATION . ':' . $this->getContext() . ':' . $this->getCacheId();
if (function_exists('xcache_unset_by_prefix')) {
// If possible, just flush the context
xcache_unset_by_prefix(prefix);
} else {
// Otherwise, we need to do this manually
for ($i = 0; $i < xcache_count(XC_TYPE_VAR); $i++) {
$cache = xcache_list(XC_TYPE_VAR, $i);
foreach ($cache['cache_list'] as $entry) {
if (substr($entry['name'], 0, strlen($prefix)) == $prefix) {
xcache_unset($entry['name']);
}
}
}
}
}
示例6: cache_clean
/**
* Clean the memory cache
*/
function cache_clean()
{
if (!TP_ENABLE_CACHE) {
return;
}
if ($this->memcache_working) {
$this->memcache->flush();
} elseif (function_exists('apc_clear_cache')) {
apc_clear_cache('user');
} elseif (function_exists('xcache_unset_by_prefix')) {
@xcache_unset_by_prefix();
}
//TODO - clean on eaccelerator is not so clean...
}
示例7: clear
public function clear($prefix = '')
{
xcache_unset_by_prefix($this->getNamespace() . $prefix);
return true;
}
示例8: free
/**
* (non-PHPdoc)
* @see \parallely\TransportInterface::free()
*/
public function free()
{
xcache_unset_by_prefix(self::PREFIX);
return $this;
}
示例9: clear
/**
* @see Cache_driver::clear()
*/
public function clear($realm = '')
{
if (!function_exists('xcache_unset_by_prefix')) {
function xcache_unset_by_prefix($prefix)
{
// Since we can't clear targetted cache, we'll clear all. :(
xcache_clear_cache(XC_TYPE_VAR, 0);
}
}
if (empty($realm)) {
xcache_unset_by_prefix('');
} else {
xcache_unset_by_prefix($realm . '/');
}
return true;
}
示例10: flush
/**
* (Plug-in replacement for memcache API) Remove all data from the persistant cache.
*/
function flush()
{
xcache_unset_by_prefix('');
}
示例11: clear
function clear($prefix_ = null)
{
if (null === $prefix_) {
xcache_unset_by_prefix(COMPONENTS_CACHE_NAMESPACE);
} else {
xcache_unset_by_prefix(COMPONENTS_CACHE_NAMESPACE . "-{$prefix_}");
}
}
示例12: flushStore
protected function flushStore($cacheId)
{
$prefix = \Cachet\Helper::formatKey([$this->prefix, $cacheId]);
xcache_unset_by_prefix($prefix);
}
示例13: deleteByPrefix
public function deleteByPrefix($key)
{
if ($key != null) {
$result = xcache_unset_by_prefix($this->prefix . $key);
} else {
return false;
}
}
示例14: flush
/**
* Emulates `Memcache::flush`.
*/
public function flush()
{
return xcache_unset_by_prefix(self::$key_prefix);
}
示例15: truncate
public function truncate()
{
xcache_unset_by_prefix('');
return TRUE;
}