Changeset 1090
- Timestamp:
- 2012-07-30T17:01:09+02:00 (11 months ago)
- Location:
- trunk/htdocs
- Files:
-
- 4 edited
-
cacher/index.php (modified) (1 diff)
-
common/common.php (modified) (1 diff)
-
diagnosis/diagnosis.tpl.php (modified) (1 diff)
-
diagnosis/index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htdocs/cacher/index.php
r1088 r1090 257 257 xcache_count(XC_TYPE_PHP); // trigger auth 258 258 if (!extension_loaded('XCache')) { 259 include "../common/header.tpl.php"; 260 echo '<h1>XCache is not loaded</h1>'; 261 ob_start(); 262 phpinfo(INFO_GENERAL); 263 $info = ob_get_clean(); 264 if (preg_match_all("!<tr>[^<]*<td[^>]*>[^<]*(?:Configuration|ini|Server API)[^<]*</td>[^<]*<td[^>]*>[^<]*</td>[^<]*</tr>!s", $info, $m)) { 265 echo '<div class="phpinfo">'; 266 echo 'PHP Info'; 267 echo '<table>'; 268 echo implode('', $m[0]); 269 echo '</table>'; 270 echo '</div>'; 271 } 272 if (preg_match('!<td class="v">(.*?\\.ini)!', $info, $m)) { 273 echo "Please check $m[1]"; 274 } 275 else if (preg_match('!Configuration File \\(php.ini\\) Path *</td><td class="v">([^<]+)!', $info, $m)) { 276 echo "Please put a php.ini in $m[1] and load XCache extension"; 277 } 278 else { 279 echo "You don't even have a php.ini yet?"; 280 } 281 echo "(See above)"; 282 include "../common/footer.tpl.php"; 259 header("Location: ../diagnosis"); 283 260 exit; 284 261 } -
trunk/htdocs/common/common.php
r1089 r1090 149 149 } 150 150 if (!empty($GLOBALS['config']['show_todo_strings'])) { 151 return '<span style="color:red">' . htmlspecialchars($str). '</span>|';151 return '<span style="color:red">' . $str . '</span>|'; 152 152 } 153 153 return $str; -
trunk/htdocs/diagnosis/diagnosis.tpl.php
r1089 r1090 1 1 <?php include "../common/header.tpl.php"; ?> 2 <table cellspacing="0" cellpadding="4" class="cycles"> 3 <caption> 4 <?php echo _T("Diagnosis Result"); ?> 5 </caption> 6 <tr> 7 <th> 8 <?php echo _T("Level"); ?> 9 </th> 10 <th> 11 <?php echo _T("Reason"); ?> 12 </th> 13 <th> 14 <?php echo _T("Suggestion"); ?> 15 </th> 16 </tr> 17 <?php foreach ($notes as $note) { ?> 18 <tr> 19 <td><?php echo ucfirst($note['type']); ?></td> 20 <td><?php echo $note['reason']; ?></td> 21 <td><?php echo $note['suggestion']; ?></td> 22 </tr> 23 <?php } ?> 24 </table> 2 25 <?php include "../common/footer.tpl.php"; ?> -
trunk/htdocs/diagnosis/index.php
r1089 r1090 6 6 7 7 $notes = array(); 8 function note($type, $reason, $suggestion )8 function note($type, $reason, $suggestion = "ok") // {{{ 9 9 { 10 10 global $notes; … … 15 15 ); 16 16 } 17 17 // }}} 18 18 function getCacheInfos() // {{{ 19 19 { … … 35 35 return $cacheInfos; 36 36 } 37 // }}} 37 38 38 $cacheInfos = getCacheInfos(); 39 if (!extension_loaded('XCache')) { 40 ob_start(); 41 phpinfo(INFO_GENERAL); 42 $info = ob_get_clean(); 43 ob_start(); 44 if (preg_match_all("!<tr>[^<]*<td[^>]*>[^<]*(?:Configuration|ini|Server API)[^<]*</td>[^<]*<td[^>]*>[^<]*</td>[^<]*</tr>!s", $info, $m)) { 45 echo '<div class="phpinfo">'; 46 echo 'PHP Info'; 47 echo '<table>'; 48 echo implode('', $m[0]); 49 echo '</table>'; 50 echo '</div>'; 51 } 52 if (preg_match('!<td class="v">(.*?\\.ini)!', $info, $m)) { 53 echo "Please check $m[1]"; 54 } 55 else if (preg_match('!Configuration File \\(php.ini\\) Path *</td><td class="v">([^<]+)!', $info, $m)) { 56 echo "Please put a php.ini in $m[1] and load XCache extension"; 57 } 58 else { 59 echo "You don't even have a php.ini yet?"; 60 } 61 echo "(See above)"; 62 note("error", _T('XCache is not loaded'), ob_get_clean()); 63 } 64 else { 65 note("info", _T('XCache loaded')); 39 66 40 // if (!$ini['xcache.size'] || !$ini['xcache.cacher']) { 67 $cacheInfos = getCacheInfos(); 41 68 42 foreach ($cacheInfos as $cacheInfo) { 43 if ($cacheInfo['ooms']) { 69 if (!ini_get("xcache.size") || !ini_get("xcache.cacher")) { 70 note( 71 "error" 72 , _T("XCache is not enabled. Website is not accelerated by XCache") 73 , _T("Set xcache.size to non-zero, set xcache.cacher = On") 74 ); 75 } 76 else { 77 note("info", _T('XCache Enabled')); 78 } 79 80 $ooms = false; 81 foreach ($cacheInfos as $cacheInfo) { 82 if ($cacheInfo['ooms']) { 83 $ooms = true; 84 break; 85 } 86 } 87 if ($ooms) { 44 88 note( 45 89 "warning" 46 , "Out of memory happened when trying to write to cache"90 , _T("Out of memory happened when trying to write to cache") 47 91 , "Increase xcache.size and/or xcache.var_size" 48 92 ); 49 break;50 93 } 51 } 94 else { 95 note("info", _T('XCache Memory Size')); 96 } 52 97 53 foreach ($cacheInfos as $cacheInfo) { 54 if ($cacheInfo['errors']) { 98 $errors = false; 99 foreach ($cacheInfos as $cacheInfo) { 100 if ($cacheInfo['errors']) { 101 $errors = true; 102 break; 103 } 104 } 105 if ($errors) { 55 106 note( 56 107 "warning" 57 , "Error happened when compiling your PHP code"58 , "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"108 , _T("Error happened when compiling at least one of your PHP code") 109 , _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") 59 110 ); 60 break;61 111 } 112 else { 113 note("info", _T('All PHP scripts seem fine')); 114 } 115 116 /* 117 if ($ini['xcache.count'] < cpucount() * 2) { 118 } 119 120 if ($ini['xcache.size'] is small $ini['xcache.slots'] is big) { 121 } 122 123 if ($ini['xcache.readonly_protection']) { 124 } 125 126 if ($cache['compiling']) { 127 } 128 129 if ($cache['compiling']) { 130 } 131 132 if ($cache['disabled']) { 133 } 134 */ 62 135 } 63 136 64 137 /* 65 if ($ini['xcache.count'] < cpucount() * 2) {66 }67 68 if ($ini['xcache.size'] is small $ini['xcache.slots'] is big) {69 }70 71 if ($ini['xcache.readonly_protection']) {72 }73 74 if ($cache['compiling']) {75 }76 77 if ($cache['compiling']) {78 }79 80 if ($cache['disabled']) {81 }82 138 83 139 if (($coredumpFiles = globCoreDumpFiles()) {
Note: See TracChangeset
for help on using the changeset viewer.

