本文整理汇总了PHP中eaccelerator_list_keys函数的典型用法代码示例。如果您正苦于以下问题:PHP eaccelerator_list_keys函数的具体用法?PHP eaccelerator_list_keys怎么用?PHP eaccelerator_list_keys使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eaccelerator_list_keys函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: purge
/**
* Purge cache data
*
* @return void
*/
function purge()
{
foreach (eaccelerator_list_keys() as $var) {
// @todo Check why the substr()
// @todo Only unset vars matching $this->key_prefix
eaccelerator_rm(substr($var['name'], 1));
}
parent::purge();
}
示例2: flush
public function flush()
{
$v9b207167e5381c47682c6b4f58a623fb = eaccelerator_clear();
$v14f802e1fba977727845e8872c1743a7 = eaccelerator_list_keys();
foreach ($v14f802e1fba977727845e8872c1743a7 as $v3c6e0b8a9c15224a8228b9a98ca1531d) {
eaccelerator_rm(substr($v3c6e0b8a9c15224a8228b9a98ca1531d['name'], 1));
}
return $v9b207167e5381c47682c6b4f58a623fb;
}
示例3: flushAll
/**
* Deletes all EAccelerator data cache
*/
public function flushAll()
{
//delete expired content then delete all
eaccelerator_gc();
$idkeys = eaccelerator_list_keys();
foreach ($idkeys as $k) {
$this->flush(substr($k['name'], 1));
}
}
示例4: flush
/**
* 清空cache中所有项, 全部清除需要遍历cache,一个一个删除!
* @return void
* @access public
*/
public static function flush()
{
// 清除过期的key
eaccelerator_gc();
// 遍历key,一个一个删除
$list = eaccelerator_list_keys();
foreach ($list as $k => $v) {
self::delete($v['name']);
}
}
示例5: flush
public function flush()
{
// first, remove expired content from cache
eaccelerator_gc();
// now, remove leftover cache-keys
$keys = eaccelerator_list_keys();
foreach ($keys as $key) {
$this->deleteValue(substr($key['name'], 1));
}
}
示例6: removeAllByPrefix
/**
* remove all data from cache by key prefix
* @return true on success
*/
function removeAllByPrefix($s)
{
$l = strlen($s);
$aKeys = eaccelerator_list_keys();
foreach ($aKeys as $aKey) {
$sKey = 0 === strpos($aKey['name'], ':') ? substr($aKey['name'], 1) : $aKey['name'];
if (0 == strncmp($sKey, $s, $l)) {
$this->delData($sKey);
}
}
return true;
}
示例7: getCacheKeys
/**
* @return array
*/
public function getCacheKeys()
{
$infos = eaccelerator_list_keys();
if (!is_array($infos)) {
return null;
}
$keys = array();
foreach ($infos as $info) {
$keys[] = substr($info['name'], strlen($this->getOption('prefix')));
}
return $keys;
}
示例8: clean
public function clean($group, $mode = null)
{
$keys = eaccelerator_list_keys();
$secret = $this->_hash;
if (is_array($keys)) {
foreach ($keys as $key) {
$key['name'] = ltrim($key['name'], ':');
if (strpos($key['name'], $secret . '-cache-' . $group . '-') === 0 xor $mode != 'group') {
eaccelerator_rm($key['name']);
}
}
}
return true;
}
示例9: destroy_all
function destroy_all()
{
if (!function_exists('eaccelerator_list_keys')) {
return;
}
$key_list = eaccelerator_list_keys();
$key_length = strlen($this->key);
foreach ($key_list as $key) {
if (strpos($key['name'], $this->key) === 0) {
eaccelerator_rm($key['name']);
$this->remove(substr($key['name'], $key_length));
}
}
$this->reset();
}
示例10: clean
/**
* Clean cache for a group given a mode.
*
* group mode : cleans all cache in the group
* notgroup mode : cleans all cache not in the group
*
* @access public
* @param string $group The cache data group
* @param string $mode The mode for cleaning cache [group|notgroup]
* @return boolean True on success, false otherwise
* @since 1.5
*/
function clean($group, $mode)
{
$keys = eaccelerator_list_keys();
$secret = $this->_hash;
if (is_array($keys)) {
foreach ($keys as $key) {
/* Trim leading ":" to work around list_keys namespace bug in eAcc. This will still work when bug is fixed */
$key['name'] = ltrim($key['name'], ':');
if (strpos($key['name'], $secret . '-cache-' . $group . '-' . $this->_site) === 0 xor $mode != 'group') {
eaccelerator_rm($key['name']);
}
}
}
return true;
}
示例11: info
public function info()
{
$info = array();
$info['info'] = eaccelerator_info();
$info['keys'] = eaccelerator_list_keys();
$info['script'] = eaccelerator_cached_scripts();
$info['script_remove'] = eaccelerator_removed_scripts();
return $info;
}
示例12: stats
/**
* Get stats and usage Informations for display from eAccelerator
*/
public function stats()
{
// get info Get info about eAccelerator
$eac_sysinfos['infos'] = eaccelerator_info();
// List cached keys
$keys = eaccelerator_list_keys();
if (is_array($keys)) {
foreach ($keys as $key) {
$eac_sysinfo['keys'][] = $key;
}
}
return null;
}
示例13: create_script_table
print "<tr " . $bc[$var] . ">";
print "<td>Purge cache</td>";
print '<td align="right"><input type="submit" class="butAction" name="purge" value="purge" title="remove all \'removed\' scripts from shared memory" /></td>';
print "</tr></table></form>";
}
if (is_array($resCached)) {
print "<br><br>";
print "<b>Cached scripts</b><br>";
create_script_table($resCached);
}
if (is_array($resRemoved)) {
print "<br><br>";
print "<b>Removed scripts</b><br>";
create_script_table($resRemoved);
}
} else {
print "<br><br>";
print "Check in your <b>php.ini</b> that <b>eaccelerator.allowed_admin_path</b> parameter is : ";
print "<br><br>";
print "<b>" . $_SERVER["SCRIPT_FILENAME"] . "</b>";
print "<br><br>";
}
if (function_exists('eaccelerator_get')) {
print '<br><br>';
print '<b>Cached keys</b><br>';
$res = eaccelerator_list_keys();
create_key_table($res);
}
print "<br><br>";
llxFooter();
$db->close();
示例14: create_script_table
<!-- }}} -->
<h2>Cached scripts</h2>
<?php
create_script_table(eaccelerator_cached_scripts());
?>
<h2>Removed scripts</h2>
<?php
create_script_table(eaccelerator_removed_scripts());
?>
<?php
if (function_exists('eaccelerator_get')) {
echo "<h2>Cached keys</h2>";
create_key_table(eaccelerator_list_keys());
}
?>
<!-- {{{ footer -->
<br /><br />
<table>
<tr><td class="center">
<a href="http://eaccelerator.net"><img src="?=<?php
echo $info['logo'];
?>
" alt="eA logo" /></a>
<strong>Created by the eAccelerator team, <a href="http://eaccelerator.net">http://eaccelerator.net</a></strong><br /><br />
<nobr>eAccelerator <?php
echo $info['version'];
?>
示例15: getIds
/**
* {@inheritdoc}
*/
public function getIds()
{
return eaccelerator_list_keys();
}