Changeset 1169 in svn for trunk


Ignore:
Timestamp:
2012-11-13T07:16:50+01:00 (3 years ago)
Author:
Xuefer
Message:

fixed undefined variable when XCache is not loaded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/diagnosis/index.php

    r1125 r1169  
    218218// }}}
    219219checking(_T("Hash Slots")); // {{{
    220 $slotsTooBig = null;
    221 $slotsTooSmall = null;
    222 foreach ($cacheInfos as $cacheInfo) {
    223     if ($cacheInfo['size'] < '1024000' && $cacheInfo['slots'] >= '8192') {
    224         $slotsTooBig = $cacheInfo['type'];
    225         break;
    226     }
    227     if ($cacheInfo['slots'] < $cacheInfo['cached'] / 2) {
    228         $slotsTooSmall = $cacheInfo['type'];
    229         break;
    230     }
    231 }
    232 if (isset($slotsTooBig)) {
    233     $prefix = $slotsTooBig == XC_TYPE_PHP ? '' : 'var_';
    234     result(N_("warning")
    235         , _T("Slots value too big")
    236         , sprintf(_T("A very small value is set to %s value and leave %s value is too big.\n"
    237             . "Decrease %s if small cache is really what you want"), "xcache.{$prefix}size", "xcache.{$prefix}slots", "xcache.{$prefix}slots")
    238         );
    239 }
    240 else if (isset($slotsTooSmall)) {
    241     $prefix = $slotsTooSmall == XC_TYPE_PHP ? '' : 'var_';
    242     result(N_("warning")
    243         , _T("Slots value too small")
    244         , sprintf(_T("So many item are cached. Increase %s to a more proper value"), "xcache.{$prefix}slots")
    245         );
    246 }
    247 else {
    248     result(N_("info"), _T('Looks good'));
     220if (!$xcacheLoaded) {
     221    result(N_("skipped"), "XCache not loaded");
     222}
     223else {
     224    $slotsTooBig = null;
     225    $slotsTooSmall = null;
     226    foreach ($cacheInfos as $cacheInfo) {
     227        if ($cacheInfo['size'] < '1024000' && $cacheInfo['slots'] >= '8192') {
     228            $slotsTooBig = $cacheInfo['type'];
     229            break;
     230        }
     231        if ($cacheInfo['slots'] < $cacheInfo['cached'] / 2) {
     232            $slotsTooSmall = $cacheInfo['type'];
     233            break;
     234        }
     235    }
     236    if (isset($slotsTooBig)) {
     237        $prefix = $slotsTooBig == XC_TYPE_PHP ? '' : 'var_';
     238        result(N_("warning")
     239            , _T("Slots value too big")
     240            , sprintf(_T("A very small value is set to %s value and leave %s value is too big.\n"
     241                . "Decrease %s if small cache is really what you want"), "xcache.{$prefix}size", "xcache.{$prefix}slots", "xcache.{$prefix}slots")
     242            );
     243    }
     244    else if (isset($slotsTooSmall)) {
     245        $prefix = $slotsTooSmall == XC_TYPE_PHP ? '' : 'var_';
     246        result(N_("warning")
     247            , _T("Slots value too small")
     248            , sprintf(_T("So many item are cached. Increase %s to a more proper value"), "xcache.{$prefix}slots")
     249            );
     250    }
     251    else {
     252        result(N_("info"), _T('Looks good'));
     253    }
    249254}
    250255// }}}
Note: See TracChangeset for help on using the changeset viewer.