本文整理汇总了PHP中dumpCacheSlab函数的典型用法代码示例。如果您正苦于以下问题:PHP dumpCacheSlab函数的具体用法?PHP dumpCacheSlab怎么用?PHP dumpCacheSlab使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dumpCacheSlab函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$items = $cacheItems['items'];
$totals = $cacheItems['counts'];
$maxDump = MAX_ITEM_DUMP;
foreach ($items as $server => $entries) {
echo <<<EOB
\t\t\t<div class="info"><table cellspacing=0><tbody>
\t\t\t<tr><th colspan="2">{$server}</th></tr>
\t\t\t<tr><th>Slab Id</th><th>Info</th></tr>
EOB;
foreach ($entries as $slabId => $slab) {
$dumpUrl = $PHP_SELF . '&op=2&server=' . array_search($server, $MEMCACHE_SERVERS) . '&dumpslab=' . $slabId;
echo "<tr class=tr-{$m}>", "<td class=td-0><center>", '<a href="', $dumpUrl, '">', $slabId, '</a>', "</center></td>", "<td class=td-last><b>Item count:</b> ", $slab['number'], '<br/><b>Age:</b>', duration($time - $slab['age']), '<br/> <b>Evicted:</b>', isset($slab['evicted']) && $slab['evicted'] == 1 ? 'Yes' : 'No';
if (isset($_GET['dumpslab']) && $_GET['dumpslab'] == $slabId && (isset($_GET['server']) && $_GET['server'] == array_search($server, $MEMCACHE_SERVERS))) {
echo "<br/><b>Items: item</b><br/>";
$items = dumpCacheSlab($server, $slabId, $slab['number']);
// maybe someone likes to do a pagination here :)
$i = 1;
foreach ($items['ITEM'] as $itemKey => $itemInfo) {
$itemInfo = trim($itemInfo, '[ ]');
echo '<a href="', $PHP_SELF, '&op=4&server=', array_search($server, $MEMCACHE_SERVERS), '&key=', base64_encode($itemKey) . '">', $itemKey, '</a>';
if ($i++ % 10 == 0) {
echo '<br/>';
} elseif ($i != $slab['number'] + 1) {
echo ',';
}
}
}
echo "</td></tr>";
$m = 1 - $m;
}
示例2: foreach
\t\t\t<tr><th>Slab Id</th><th>Info</th></tr>
EOB;
foreach ($entries as $slabId => $slab) {
$dumpUrl = $PHP_SELF . '&op=2&server=' . array_search($server, $MEMCACHE_SERVERS) . '&dumpslab=' . $slabId;
echo "<tr class=tr-{$m}>", "<td class=td-0><center>", '<a href="', $dumpUrl, '">', $slabId, '</a>', "</center></td>", "<td class=td-last><b>Item count:</b> ", $slab['number'], '<br/><b>Age:</b>', duration($time - $slab['age']), '<br/><b>Evicted:</b> ', isset($slab['evicted']) ? $slab['evicted'] : 'No', '<br/><b>chunk size:</b> ', $slab['chunk_size'], '', '<br/><b>chunks per page:</b> ', $slab['chunks_per_page'], '<br/><b>total chunks:</b> ', $slab['total_chunks'], '<br/><b>used chunks:</b> ', $slab['used_chunks'], '<br/><b>free chunks:</b> ', $slab['free_chunks'], '<br/><b>free chunks_end:</b> ', $slab['free_chunks_end'], '<br/><b>total pages:</b> ', $slab['total_pages'], '<br/><b>total memory:</b> ', bsize($slab['chunk_size'] * $slab['total_chunks']);
if ($slab['number'] && (isset($_GET['dumpslab']) && $_GET['dumpslab'] == $slabId) && (isset($_GET['server']) && $_GET['server'] == array_search($server, $MEMCACHE_SERVERS))) {
echo "<br/><b>Items: item</b><br/>";
if (isset($_GET['dumplimit'])) {
$dump_limit = intval($_GET['dumplimit']);
} else {
$dump_limit = $slab['number'];
}
if ($dump_limit > 100 || $dump_limit < 1) {
$dump_limit = 100;
}
$items = dumpCacheSlab($server, $slabId, $dump_limit);
// maybe someone likes to do a pagination here :)
$i = 1;
foreach ($items['ITEM'] as $itemKey => $itemInfo) {
$itemInfo = trim($itemInfo, '[ ]');
echo '<a href="', $PHP_SELF, '&op=4&server=', array_search($server, $MEMCACHE_SERVERS), '&key=', base64_encode($itemKey) . '">', $itemKey, '</a>';
if ($i++ % 10 == 0) {
echo '<br/>';
} elseif ($i != $slab['number'] + 1) {
echo ',';
}
}
}
echo "</td></tr>";
$m = 1 - $m;
}