1
0
Fork 0

adds diagnosis module

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1089 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 11 years ago
parent 31c41353a6
commit f9b4ab0c41

@ -5,6 +5,8 @@ $strings += array(
=> '缓存器',
'Coverager'
=> '代码覆盖查看器',
'Diagnosis'
=> '诊断',
'Document'
=> '帮助文档',
'INI Reference'

@ -5,6 +5,8 @@ $strings += array(
=> '快取器',
'Coverager'
=> '代码覆盖查看器',
'Diagnosis'
=> '診斷',
'Document'
=> '幫助文檔',
'INI Reference'

@ -269,6 +269,9 @@ if (file_exists("../cacher/index.php")) {
if (file_exists("../coverager/index.php")) {
$modules["coverager"] = _T("Coverager");
}
if (file_exists("../diagnosis/index.php")) {
$modules["diagnosis"] = _T("Diagnosis");
}
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Content-Type: text/html; " . $GLOBALS['config']['charset']);

@ -0,0 +1,2 @@
<?php include "../common/header.tpl.php"; ?>
<?php include "../common/footer.tpl.php"; ?>

@ -0,0 +1,103 @@
<?php
include "../common/common.php";
$module = "diagnosis";
$notes = array();
function note($type, $reason, $suggestion)
{
global $notes;
$notes[] = array(
'type' => $type
, 'reason' => $reason
, 'suggestion' => $suggestion
);
}
function getCacheInfos() // {{{
{
$phpCacheCount = xcache_count(XC_TYPE_PHP);
$varCacheCount = xcache_count(XC_TYPE_VAR);
$cacheInfos = array();
for ($i = 0; $i < $phpCacheCount; $i ++) {
$cacheInfo = xcache_info(XC_TYPE_PHP, $i);
$cacheInfo['type'] = XC_TYPE_PHP;
$cacheInfos[] = $cacheInfo;
}
for ($i = 0; $i < $varCacheCount; $i ++) {
$cacheInfo = xcache_info(XC_TYPE_VAR, $i);
$cacheInfo['type'] = XC_TYPE_VAR;
$cacheInfos[] = $cacheInfo;
}
return $cacheInfos;
}
$cacheInfos = getCacheInfos();
// if (!$ini['xcache.size'] || !$ini['xcache.cacher']) {
foreach ($cacheInfos as $cacheInfo) {
if ($cacheInfo['ooms']) {
note(
"warning"
, "Out of memory happened when trying to write to cache"
, "Increase xcache.size and/or xcache.var_size"
);
break;
}
}
foreach ($cacheInfos as $cacheInfo) {
if ($cacheInfo['errors']) {
note(
"warning"
, "Error happened when compiling your PHP code"
, "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"
);
break;
}
}
/*
if ($ini['xcache.count'] < cpucount() * 2) {
}
if ($ini['xcache.size'] is small $ini['xcache.slots'] is big) {
}
if ($ini['xcache.readonly_protection']) {
}
if ($cache['compiling']) {
}
if ($cache['compiling']) {
}
if ($cache['disabled']) {
}
if (($coredumpFiles = globCoreDumpFiles()) {
}
if (module not for server) {
}
$phpVersion = php_version();
foreach ($knownUnstablePhpVersion as $unstablePhpVersion => $reason) {
if (substr($phpVersion, 0, strlen($unstablePhpVersion)) == $unstablePhpVersion) {
// ..
}
}
if (Zend Optimizer is loaded, zend optimize level > 0) {
warn("disabled");
}
*/
include "./diagnosis.tpl.php";
Loading…
Cancel
Save