source: trunk/htdocs/diagnosis/index.php @ 1089

Last change on this file since 1089 was 1089, checked in by moo, 21 months ago

adds diagnosis module

  • Property svn:eol-style set to native
File size: 1.9 KB
RevLine 
[1089]1<?php
2
3include "../common/common.php";
4
5$module = "diagnosis";
6
7$notes = array();
8function note($type, $reason, $suggestion)
9{
10    global $notes;
11    $notes[] = array(
12            'type' => $type
13            , 'reason' => $reason
14            , 'suggestion' => $suggestion
15            );
16}
17
18function 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
42foreach ($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
53foreach ($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/*
65if ($ini['xcache.count'] < cpucount() * 2) {
66}
67
68if ($ini['xcache.size'] is small $ini['xcache.slots'] is big) {
69}
70
71if ($ini['xcache.readonly_protection']) {
72}
73
74if ($cache['compiling']) {
75}
76
77if ($cache['compiling']) {
78}
79
80if ($cache['disabled']) {
81}
82
83if (($coredumpFiles = globCoreDumpFiles()) {
84}
85
86if (module not for server) {
87}
88
89$phpVersion = php_version();
90foreach ($knownUnstablePhpVersion as $unstablePhpVersion => $reason) {
91    if (substr($phpVersion, 0, strlen($unstablePhpVersion)) == $unstablePhpVersion) {
92        // ..
93    }
94}
95
96if (Zend Optimizer is loaded, zend optimize level > 0) {
97    warn("disabled");
98}
99
100*/
101
102include "./diagnosis.tpl.php";
103
Note: See TracBrowser for help on using the repository browser.