Changeset 1041 for trunk


Ignore:
Timestamp:
2012-07-25T06:24:02+02:00 (2 years ago)
Author:
moo
Message:

cacher/admin: adds more phpinfo when XCache is not loaded. improve looking in module info

Location:
trunk/mod_cacher/htdocs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/htdocs/xcache.css

    r1020 r1041  
    11input, table { font-family: sans-serif; } 
    22input { font-size: 12px; } 
    3 table { border-collapse: collapse; font-size: 11px; margin: 0; margin-bottom: 10px; } 
    4 table caption, h2 { font-size: 16px; font-weight: bold; text-align: left; padding-top: 20px; margin-bottom: 2px; } 
     3table { border-collapse: collapse; font-size: 11px; margin: 0; } 
     4table caption, h2, h3 { font-size: 16px; font-weight: bold; text-align: left; padding-top: 20px; margin-bottom: 2px; } 
     5h3 { font-size: 14px; padding-top: 2px; margin-bottom: 0px; } 
    56td, th { white-space: pre; } 
    67table.cycles { border: 1px solid black; margin-top: 5px; margin-bottom: 5px; } 
     
    1112th a { color: black; font-weight: bold; display: block; width: 100%; height: 100%; } 
    1213th { font-size: 12px; } 
    13 .moduleinfo table { border: 1px solid black; } 
    14 .moduleinfo table th, .moduleinfo table td { border: 1px solid black; } 
    15 .moduleinfo table th { font-weight: bold; } 
    16 .moduleinfo .e {background-color: #ccccff; font-weight: bold; color: #000000;} 
    17 .moduleinfo .h {background-color: #9999cc; font-weight: bold; color: #000000;} 
    18 .moduleinfo .v {background-color: #cccccc; color: #000000;} 
     14.phpinfo table { border: 1px solid black; margin-bottom: 1px; } 
     15.phpinfo table th, .phpinfo table td { border: 1px solid black; } 
     16.phpinfo table th { font-weight: bold; } 
     17.phpinfo .e {background-color: #ccccff; font-weight: bold; color: #000000;} 
     18.phpinfo .h {background-color: #9999cc; font-weight: bold; color: #000000;} 
     19.phpinfo .v {background-color: #cccccc; color: #000000;} 
    1920.button { } 
    2021span.sortarrow { color: white; text-decoration: none; } 
  • trunk/mod_cacher/htdocs/xcache.php

    r1038 r1041  
    207207} 
    208208 
     209$php_version = phpversion(); 
     210$xcache_version = XCACHE_VERSION; 
     211$xcache_modules = XCACHE_MODULES; 
     212 
    209213if (!extension_loaded('XCache')) { 
     214    include("header.tpl.php"); 
    210215    echo '<h1>XCache is not loaded</h1>'; 
    211216    ob_start(); 
    212     phpinfo(); 
     217    phpinfo(INFO_GENERAL); 
    213218    $info = ob_get_clean(); 
    214     if (preg_match('!<td class="v">(.*\\.ini)!', $info, $m)) { 
     219    if (preg_match_all("!<tr>[^<]*<td[^>]*>[^<]*(?:Configuration|ini|Server API)[^<]*</td>[^<]*<td[^>]*>[^<]*</td>[^<]*</tr>!s", $info, $m)) { 
     220        echo '<div class="phpinfo">'; 
     221        echo 'PHP Info'; 
     222        echo '<table>'; 
     223        echo implode('', $m[0]); 
     224        echo '</table>'; 
     225        echo '</div>'; 
     226    } 
     227    if (preg_match('!<td class="v">(.*?\\.ini)!', $info, $m)) { 
    215228        echo "Please check $m[1]"; 
    216229    } 
     
    221234        echo "You don't even have a php.ini yet?"; 
    222235    } 
     236    echo "(See above)"; 
     237    include("footer.tpl.php"); 
    223238    exit; 
    224239} 
     
    369384    phpinfo(INFO_MODULES); 
    370385    $moduleinfo = ob_get_clean(); 
    371     if (preg_match_all('!XCache[^<]*</a></h2>(.*?)<h2>!is', $moduleinfo, $m)) { 
    372         $moduleinfo = implode('', $m[1]); 
     386    if (preg_match_all('!(XCache[^<>]*)</a></h2>(.*?)<h2>!is', $moduleinfo, $m)) { 
     387        $moduleinfo = array(); 
     388        foreach ($m[1] as $i => $dummy) { 
     389            $moduleinfo[] = '<h3>' . trim($m[1][$i]) . '</h3>'; 
     390            $moduleinfo[] = str_replace('<br />', '', trim($m[2][$i])); 
     391        } 
     392        $moduleinfo = implode('', $moduleinfo); 
    373393    } 
    374394    else { 
     
    382402$type_var = XC_TYPE_VAR; 
    383403$types = array($type_none => _('Statistics'), $type_php => _('List PHP'), $type_var => _('List Var Data')); 
    384 $php_version = phpversion(); 
    385 $xcache_version = XCACHE_VERSION; 
    386 $xcache_modules = XCACHE_MODULES; 
    387404 
    388405include("xcache.tpl.php"); 
  • trunk/mod_cacher/htdocs/xcache.tpl.php

    r1038 r1041  
    295295    echo <<<HTML 
    296296<h2>$t_moduleinfo</h2> 
    297 <div class="moduleinfo">$moduleinfo</div> 
     297<div class="phpinfo">$moduleinfo</div> 
    298298HTML; 
    299299} 
Note: See TracChangeset for help on using the changeset viewer.