示例#1
0
function getEntryList()
{
    static $entryList;
    if (isset($entryList)) {
        return $entryList;
    }
    $entryList = array('cache_list' => array(), 'deleted_list' => array());
    if ($_GET['do'] == 'listphp') {
        $entryList['type'] = XC_TYPE_PHP;
    } else {
        $entryList['type'] = XC_TYPE_VAR;
    }
    foreach (getCacheInfos() as $i => $c) {
        if (!empty($c['istotal'])) {
            continue;
        }
        if ($c['type'] == $entryList['type'] && isset($c['cache_list'])) {
            foreach ($c['cache_list'] as $e) {
                $e['cache_name'] = $c['cache_name'];
                $entryList['cache_list'][] = $e;
            }
            foreach ($c['deleted_list'] as $e) {
                $e['cache_name'] = $c['cache_name'];
                $entryList['deleted_list'][] = $e;
            }
        }
    }
    return $entryList;
}
</caption>
	<tr>
	<?php 
echo th(N_("cache.cache")), th(N_("cache.slots")), th(N_("cache.size")), th(N_("cache.avail")), th(N_("cache.blocksgraph")), th(N_("cache.operations")), th(N_("cache.status")), th(N_("cache.hits")), th(N_("cache.hits_graph")), th(N_("cache.hits_avg_h")), th(N_("cache.hits_avg_s")), th(N_("cache.updates")), th(N_("cache.skips")), th(N_("cache.ooms")), th(N_("cache.errors")), th(N_("cache.readonly_protected")), th(N_("cache.cached")), th(N_("cache.deleted")), th(N_("cache.gc_timer"));
?>
	</tr>
	<?php 
$numkeys = explode(',', 'slots,size,avail,hits,updates,skips,ooms,errors,cached,deleted');
$l_clear = _T('Clear');
$l_disabled = _T('Disabled');
$l_disable = _T('Disable');
$l_enable = _T('Enable');
$l_compiling = _T('Compiling');
$l_normal = _T('Normal');
$l_confirm = _T('Sure?');
foreach (getCacheInfos() as $i => $ci) {
    $class = $cycleClass->next();
    echo <<<TR
\t<tr {$class}>

TR;
    $pvalue = (int) ($ci['avail'] / $ci['size'] * 100);
    $pempty = 100 - $pvalue;
    if ($config['percent_graph_type'] == 'used') {
        // swap
        $tmp = $pvalue;
        $pvalue = $pempty;
        $pempty = $tmp;
    }
    $w = $config['percent_graph_width'] + 2;
    if (empty($ci['istotal'])) {
示例#3
0
    } else {
        if ($iniDirectory) {
            echo sprintf(_T("Please put a php.ini in %s and add extension=xcache.so (or xcache.dll) in it"), $iniDirectory);
        } else {
            echo _T("Cannot detect php.ini location");
        }
    }
    echo " ", _T("(See above)");
    result(N_("error"), _T('Not loaded'), ob_get_clean());
} else {
    result(N_("info"), _T('Loaded'));
}
// }}}
if ($xcacheLoaded) {
    // {{{ load XCache summary
    $cacheInfos = getCacheInfos();
    $ooms = 0;
    $errors = 0;
    $disabled = 0;
    $compiling = 0;
    $readonlyProtection = false;
    $phpCacheCount = xcache_count(XC_TYPE_PHP);
    $phpCached = 0;
    $varCached = 0;
    foreach ($cacheInfos as $cacheInfo) {
        $ooms += $cacheInfo['ooms'];
        $errors += $cacheInfo['errors'];
        $disabled += $cacheInfo['disabled'] ? 1 : 0;
        if ($cacheInfo['type'] == XC_TYPE_PHP) {
            $compiling += $cacheInfo['compiling'] ? 1 : 0;
            $phpCached += $cacheInfo['cached'];