本文整理汇总了PHP中eZCache::fetchIDList方法的典型用法代码示例。如果您正苦于以下问题:PHP eZCache::fetchIDList方法的具体用法?PHP eZCache::fetchIDList怎么用?PHP eZCache::fetchIDList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZCache
的用法示例。
在下文中一共展示了eZCache::fetchIDList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$cli->output("The following ids are defined:");
$column = 0;
foreach ($cacheList as $cacheInfo) {
$len = strlen($cacheInfo['id']);
if ($len > $column) {
$column = $len;
}
}
$column += 2;
foreach ($cacheList as $cacheInfo) {
$cli->output($cli->stylize('emphasize', $cacheInfo['id']) . ':', false);
$cli->output(str_repeat(' ', $column - strlen($cacheInfo['id']) - 1), false);
$cli->output($cacheInfo['name']);
}
} else {
$idList = eZCache::fetchIDList($cacheList);
$cli->output("The following ids are defined: (use --verbose for more details)");
$cli->output($cli->stylize('emphasize', implode(', ', $idList)));
}
$script->shutdown(0);
}
function clearItems($cacheEntries, $cli, $name)
{
if ($name) {
$name = $cli->stylize('emphasize', $name);
}
$cli->output('Clearing ' . $name . ': ', false);
$i = 0;
foreach ($cacheEntries as $cacheEntry) {
if ($i > 0) {
$cli->output(', ', false);
示例2: foreach
$column = 0;
foreach ($cacheList as $cacheInfo) {
$len = strlen($cacheInfo['id']);
if ($len > $column) {
$column = $len;
}
}
$column += 2;
foreach ($cacheList as $cacheInfo) {
$cli->output($cli->stylize('emphasize', $cacheInfo['id']) . ':', false);
$cli->output(str_repeat(' ', $column - strlen($cacheInfo['id']) - 1), false);
$cli->output($cacheInfo['name']);
}
} else {
$cli->output("The following ids are defined: (use --verbose for more details)");
$cli->output($cli->stylize('emphasize', implode(', ', eZCache::fetchIDList($cacheList))));
}
$script->shutdown(0);
}
if ($options['clear-all']) {
$noAction = false;
if ($purge) {
$helper->purgeItems($cacheList, false, $purgeSleep, $purgeMax, $purgeExpiry);
} else {
$helper->clearItems($cacheList, false);
}
$script->shutdown(0);
}
if ($options['clear-tag']) {
$noAction = false;
$tagName = $options['clear-tag'];