Changeset 1090 for trunk/htdocs/diagnosis/index.php
- Timestamp:
- 2012-07-30T17:01:09+02:00 (10 months ago)
- File:
-
- 1 edited
-
trunk/htdocs/diagnosis/index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.

