| [1089] | 1 | <?php |
|---|
| 2 | |
|---|
| 3 | include "../common/common.php"; |
|---|
| 4 | |
|---|
| 5 | $module = "diagnosis"; |
|---|
| 6 | |
|---|
| 7 | $notes = array(); |
|---|
| 8 | function note($type, $reason, $suggestion) |
|---|
| 9 | { |
|---|
| 10 | global $notes; |
|---|
| 11 | $notes[] = array( |
|---|
| 12 | 'type' => $type |
|---|
| 13 | , 'reason' => $reason |
|---|
| 14 | , 'suggestion' => $suggestion |
|---|
| 15 | ); |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | function getCacheInfos() // {{{ |
|---|
| 19 | { |
|---|
| 20 | $phpCacheCount = xcache_count(XC_TYPE_PHP); |
|---|
| 21 | $varCacheCount = xcache_count(XC_TYPE_VAR); |
|---|
| 22 | |
|---|
| 23 | $cacheInfos = array(); |
|---|
| 24 | for ($i = 0; $i < $phpCacheCount; $i ++) { |
|---|
| 25 | $cacheInfo = xcache_info(XC_TYPE_PHP, $i); |
|---|
| 26 | $cacheInfo['type'] = XC_TYPE_PHP; |
|---|
| 27 | $cacheInfos[] = $cacheInfo; |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | for ($i = 0; $i < $varCacheCount; $i ++) { |
|---|
| 31 | $cacheInfo = xcache_info(XC_TYPE_VAR, $i); |
|---|
| 32 | $cacheInfo['type'] = XC_TYPE_VAR; |
|---|
| 33 | $cacheInfos[] = $cacheInfo; |
|---|
| 34 | } |
|---|
| 35 | return $cacheInfos; |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | $cacheInfos = getCacheInfos(); |
|---|
| 39 | |
|---|
| 40 | // if (!$ini['xcache.size'] || !$ini['xcache.cacher']) { |
|---|
| 41 | |
|---|
| 42 | foreach ($cacheInfos as $cacheInfo) { |
|---|
| 43 | if ($cacheInfo['ooms']) { |
|---|
| 44 | note( |
|---|
| 45 | "warning" |
|---|
| 46 | , "Out of memory happened when trying to write to cache" |
|---|
| 47 | , "Increase xcache.size and/or xcache.var_size" |
|---|
| 48 | ); |
|---|
| 49 | break; |
|---|
| 50 | } |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | foreach ($cacheInfos as $cacheInfo) { |
|---|
| 54 | if ($cacheInfo['errors']) { |
|---|
| 55 | note( |
|---|
| 56 | "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" |
|---|
| 59 | ); |
|---|
| 60 | break; |
|---|
| 61 | } |
|---|
| 62 | } |
|---|
| 63 | |
|---|
| 64 | /* |
|---|
| 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 | |
|---|
| 83 | if (($coredumpFiles = globCoreDumpFiles()) { |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | if (module not for server) { |
|---|
| 87 | } |
|---|
| 88 | |
|---|
| 89 | $phpVersion = php_version(); |
|---|
| 90 | foreach ($knownUnstablePhpVersion as $unstablePhpVersion => $reason) { |
|---|
| 91 | if (substr($phpVersion, 0, strlen($unstablePhpVersion)) == $unstablePhpVersion) { |
|---|
| 92 | // .. |
|---|
| 93 | } |
|---|
| 94 | } |
|---|
| 95 | |
|---|
| 96 | if (Zend Optimizer is loaded, zend optimize level > 0) { |
|---|
| 97 | warn("disabled"); |
|---|
| 98 | } |
|---|
| 99 | |
|---|
| 100 | */ |
|---|
| 101 | |
|---|
| 102 | include "./diagnosis.tpl.php"; |
|---|
| 103 | |
|---|