Changeset 1103 in svn for trunk/htdocs/diagnosis/index.php


Ignore:
Timestamp:
2012-08-01T09:11:21Z (3 years ago)
Author:
Xuefer
Message:

htdocs: fixed po2php. add translation for diagnosis

File:
1 edited

Legend:

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

    r1099 r1103  
    8585    }
    8686    else {
    87         echo _T("Cannot detect ini location");
    88     }
    89     echo _T(" (See above)");
    90     result("error", _T('Not loaded'), ob_get_clean());
    91 }
    92 else {
    93     result("info", _T('Loaded'));
     87        echo _T("Cannot detect php.ini location");
     88    }
     89    echo " ", _T("(See above)");
     90    result(N_("error"), _T('Not loaded'), ob_get_clean());
     91}
     92else {
     93    result(N_("info"), _T('Loaded'));
    9494}
    9595// }}}
     
    124124checking(_T("Enabling PHP Cacher")); // {{{
    125125if (!$xcacheLoaded) {
    126     result("skipped", "XCache not loaded");
     126    result(N_("skipped"), "XCache not loaded");
    127127}
    128128else if (!ini_get("xcache.size")) {
    129     result(
    130         "error"
    131         , _T("Not enabled: Website is not accelerated by XCache")
    132         , _T("Set xcache.size to non-zero, set xcache.cacher = On")
     129    result(N_("error")
     130        , _T("Not enabled")
     131        , _T("Your PHP pages is not accelerated by XCache. Set xcache.size to non-zero, set xcache.cacher = On")
    133132        );
    134133}
    135134else if (!$phpCached) {
    136     result(
    137         "error"
    138         , _T("No php script cached: Website is not accelerated by XCache")
    139         , _T("Set xcache.cacher = On")
    140         );
    141 }
    142 else {
    143     result("info", _T('Enabled'));
     135    result(N_("error")
     136        , _T("No php script cached")
     137        , _T("Your PHP pages is not accelerated by XCache. Set xcache.cacher = On")
     138        );
     139}
     140else {
     141    result(N_("info"), _T('Enabled'));
    144142}
    145143// }}}
    146144checking(_T("PHP Compile Time Error")); // {{{
    147145if (!$xcacheLoaded) {
    148     result("skipped", "XCache not loaded");
     146    result(N_("skipped"), "XCache not loaded");
    149147}
    150148else if (!$phpCacheCount) {
    151     result("skipped", "XCache PHP cacher not enabled");
     149    result(N_("skipped"), "XCache PHP cacher not enabled");
    152150}
    153151else if ($errors) {
    154     result(
    155         "warning"
     152    result(N_("warning")
    156153        , _T("Error happened when compiling at least one of your PHP code")
    157154        , _T("This usually means there is syntax error in your PHP code. Enable PHP error_log to see what parser error is it, fix your code")
     
    159156}
    160157else {
    161     result("info", _T('No error happened'));
     158    result(N_("info"), _T('No error happened'));
    162159}
    163160// }}}
    164161checking(_T("Busy Compiling")); // {{{
    165162if (!$xcacheLoaded) {
    166     result("skipped", "XCache not loaded");
     163    result(N_("skipped"), "XCache not loaded");
    167164}
    168165else if (!$phpCacheCount) {
    169     result("skipped", "XCache PHP cacher not enabled");
     166    result(N_("skipped"), "XCache PHP cacher not enabled");
    170167}
    171168else if ($compiling) {
    172     result(
    173         "warning"
     169    result(N_("warning")
    174170        , _T("Cache marked as busy for compiling")
    175171        , _T("It's ok if this status don't stay for long. Otherwise, it could be a sign of PHP crash/coredump, report to XCache devs")
     
    177173}
    178174else {
    179     result("info", _T('Idle'));
     175    result(N_("info"), _T('Idle'));
    180176}
    181177// }}}
    182178checking(_T("Enabling VAR Cacher")); // {{{
    183179if (!$xcacheLoaded) {
    184     result("skipped", "XCache not loaded");
     180    result(N_("skipped"), "XCache not loaded");
    185181}
    186182else if (!ini_get("xcache.var_size")) {
    187     result(
    188         "error"
    189         , _T("Not enabled: code that use xcache var cacher fall back to other backend")
    190         , _T("Set xcache.var_size to non-zero")
    191         );
    192 }
    193 else {
    194     result("info", _T('Enabled'));
     183    result(N_("error")
     184        , _T("Not enabled")
     185        , _T("PHP code that use XCache caching backend have to use other caching backend instead. Set xcache.var_size to non-zero")
     186        );
     187}
     188else {
     189    result(N_("info"), _T('Enabled'));
    195190
    196191    checking(_T("Using VAR Cacher")); // {{{
    197     if ($varCached) {
    198         result(
    199             "warning"
     192    if (!$varCached) {
     193        result(N_("warning")
    200194            , _T("No variable data cached")
    201195            , _T("Var Cacher won't work simply by enabling it."
    202                 . " PHP code must call XCache APIs like xcache_set() to use it as cache backend. 3rd party web apps may come with XCache support, config it to use XCache as cachign backend")
     196                . " PHP code must call XCache APIs like xcache_set() to use it as cache backend. 3rd party web apps may come with XCache support, config it to use XCache as caching backend")
    203197            );
    204198    }
    205199    else {
    206         result("info", _T('Cache in use'));
     200        result(N_("info"), _T('Cache in use'));
    207201    }
    208202    // }}}
     
    211205checking(_T("Cache Size")); // {{{
    212206if (!$xcacheLoaded) {
    213     result("skipped", "XCache not loaded");
     207    result(N_("skipped"), "XCache not loaded");
    214208}
    215209else if ($ooms) {
    216     result(
    217         "warning"
     210    result(N_("warning")
    218211        , _T("Out of memory happened when trying to write to cache")
    219212        , _T("Increase xcache.size and/or xcache.var_size")
     
    221214}
    222215else {
    223     result("info", _T('Enough'));
    224 }
    225 // }}}
    226 checking(_T("Slots")); // {{{
     216    result(N_("info"), _T('Enough'));
     217}
     218// }}}
     219checking(_T("Hash Slots")); // {{{
    227220$slotsTooBig = null;
    228221$slotsTooSmall = null;
     
    239232if (isset($slotsTooBig)) {
    240233    $prefix = $slotsTooBig == XC_TYPE_PHP ? '' : 'var_';
    241     result(
    242         "warning"
     234    result(N_("warning")
    243235        , _T("Slots value too big")
    244236        , sprintf(_T("A very small value is set to %s value and leave %s value is too big.\n"
     
    248240else if (isset($slotsTooSmall)) {
    249241    $prefix = $slotsTooSmall == XC_TYPE_PHP ? '' : 'var_';
    250     result(
    251         "warning"
     242    result(N_("warning")
    252243        , _T("Slots value too small")
    253244        , sprintf(_T("So many item are cached. Increase %s to a more proper value"), "xcache.{$prefix}slots")
     
    255246}
    256247else {
    257     result("info", _T('Looks good'));
     248    result(N_("info"), _T('Looks good'));
    258249}
    259250// }}}
    260251checking(_T("Cache Status")); // {{{
    261252if (!$xcacheLoaded) {
    262     result("skipped", "XCache not loaded");
     253    result(N_("skipped"), "XCache not loaded");
    263254}
    264255else if ($disabled) {
    265     result(
    266         "warning"
     256    result(N_("warning")
    267257        , _T("At least one of the caches is disabled. ")
    268             . (ini_get("xcache.crash_on_coredump") ? _T("It was disabled by PHP crash/coredump handler or You disabled it manually") : _T('You disabled it manually'))
    269258        , _T("Enable the cache.")
     259            . (ini_get("xcache.crash_on_coredump") ? " " . _T("It was disabled by PHP crash/coredump handler or you disabled it manually.") : _T('You disabled it manually.'))
    270260            . (ini_get("xcache.crash_on_coredump") ? " " . _T("If it was caused by PHP crash/coredump, report to XCache devs") : "")
    271261        );
    272262}
    273263else {
    274     result("info", _T('Idle'));
     264    result(N_("info"), _T('Idle'));
    275265}
    276266// }}}
     
    278268checking(_T("Coredump Directory")); // {{{
    279269if (!$xcacheLoaded) {
    280     result("skipped", "XCache not loaded");
     270    result(N_("skipped"), "XCache not loaded");
    281271}
    282272else if (!ini_get("xcache.coredump_directory")) {
    283     result("info"
     273    result(N_("info")
    284274            , _T("Not enabled")
    285             , _T("Enable coredump to know your PHP crash. It can also be enabled in fpm other than in XCache")
     275            , _T("Enable coredump to save debugging information in case when PHP crash. It can also be enabled in other module like php-fpm beside XCache")
    286276            );
    287277}
     
    293283    $coreFiles = glob($coreDir . "core*");
    294284    if ($coreFiles) {
    295         result("error"
     285        result(N_("error")
    296286                , _T("Core files found:\n") . implode("\n", $coreFiles)
    297                 , _T("Disable XCache PHP Cacher (xcache.size=0), remove the core file(s). If core file appears again, report call stack backtrace in the core to XCache devs")
     287                , _T("Disable XCache PHP Cacher (set xcache.size=0), remove the core file(s), then restart PHP. If core file appears again, report call stack backtrace in the core to XCache devs")
    298288                );
    299289    }
    300290    else {
    301         result("info"
     291        result(N_("info")
    302292                , _T("Enabled")
    303293                , sprintf(_T("You can see core files if PHP crash in %s if PHP crash"), ini_get("xcache.coredump_directory"))
     
    308298checking(_T("Readonly Protection")); // {{{
    309299if (!$xcacheLoaded) {
    310     result("skipped", "XCache not loaded");
     300    result(N_("skipped"), "XCache not loaded");
    311301}
    312302else if (ini_get("xcache.readonly_protection") && !$readonlyProtection) {
    313     result(
    314         "error"
     303    result(N_("error")
    315304        , _T("Set to enabled but not available")
    316305        , _T("Use xcache.mmap_path other than /dev/zero")
     
    318307}
    319308else {
    320     result(
    321         "info"
     309    result(N_("info")
    322310        , $readonlyProtection ? _T("Enabled") : _T("Disabled")
    323311        , _T("Enable readonly_protection == --performance & ++stability. "
     
    328316checking(_T("XCache modules")); // {{{
    329317if (!$xcacheLoaded) {
    330     result("skipped", "XCache not loaded");
     318    result(N_("skipped"), "XCache not loaded");
    331319}
    332320else {
     
    334322    $unexpectedModules = array_intersect($xcacheModules, array("coverager", "disassembler"));
    335323    if ($unexpectedModules) {
    336         result(
    337             "warning"
     324        result(N_("warning")
    338325            , implode("\n", $unexpectedModules)
    339             , _T("Acceptable. Module(s) listed above are built into XCache but not for production server\n"
     326            , _T("Acceptable. Module(s) listed are built into XCache but not for production server.\n"
    340327                . "Leave it as is if you're feeling good.\n"
    341                 . "Re-configure XCache with the above module(s) disabled if you're strict with server security.")
     328                . "Re-configure XCache with the module(s) disabled if you're strict with server security.")
    342329            );
    343330    }
    344331    else {
    345         result("info", _T('Idle'));
     332        result(N_("info"), _T('Idle'));
    346333    }
    347334}
     
    349336checking(_T("XCache test setting")); // {{{
    350337if (!$xcacheLoaded) {
    351     result("skipped", "XCache not loaded");
     338    result(N_("skipped"), "XCache not loaded");
    352339}
    353340else if ((int) ini_get('xcache.test') == 1) {
    354     result(
    355         "warning"
     341    result(N_("warning")
    356342        , _T("Enabled")
    357343        , _T("xcache.test is for testing only, not for server. set it to off")
     
    359345}
    360346else {
    361     result("info", _T('Disabled'));
     347    result(N_("info"), _T('Disabled'));
    362348}
    363349// }}}
     
    380366}
    381367if ($unstablePhpVersionReason) {
    382     result("error"
     368    result(N_("error")
    383369            , _T("The version of PHP you're using is known to be unstable: ") . $unstablePhpVersionReason
    384370            , _T("Upgrade to new version of PHP"));
    385371}
    386372else {
    387     result("info", _T("Looks good"));
     373    result(N_("info"), _T("Looks good"));
    388374}
    389375// }}}
     
    391377$loadedZendExtensions = get_loaded_extensions(true);
    392378if (array_search("Zend Optimizer", $loadedZendExtensions) !== false) {
    393     result(
    394         "warning"
     379    result(N_("info")
    395380        , _T("Zend Optimizer loaded")
    396381        , _T("Optimizer feature of 'Zend Optimizer' is disabled by XCache due to compatibility reason; the Loader of it is still available, encoded files are still supported")
    397382        );
    398383}
     384else {
     385    result(N_("info"), _T("Looks good"));
     386}
    399387// }}}
    400388
Note: See TracChangeset for help on using the changeset viewer.