diagnose.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:4k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: diagnose.php,v $
- // | $Date: 2004/02/10 01:34:25 $
- // | $Revision: 1.14 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - Display assorted server diagnostic and status information
- // | (administration interface)
- // +-------------------------------------------------------------+
- error_reporting(E_ALL & ~E_NOTICE);
- require_once('./global.php');
- //Nullify WTN-WDYL Team
- // default do
- $_REQUEST['do'] = trim($_REQUEST['do']);
- if (!isset($_REQUEST['do']) or $_REQUEST['do'] == "") {
- $_REQUEST['do'] = "mysql_vars";
- }
- ############################### PHP INFO ###############################
- if ($_REQUEST['do'] == 'phpinfo') {
- admin_header('Server Information', 'PHP Info');
- print $nav;
- ob_start();
- phpinfo();
- $phpinfo .= ob_get_contents();
- ob_end_clean();
- $tmp = stristr($phpinfo, '<table');
- $phpinfo = substr($phpinfo, (strlen($phpinfo) - strlen($tmp)), -19);
- print str_replace( 'width="600"', 'width="450"', $phpinfo);
- }
- ############################### INI VARS ###############################
- if ($_REQUEST['do'] == 'inivars') {
- admin_header('PHP Environment Variables', 'PHP Info');
- print $nav;
- foreach (ini_get_all() AS $key => $var) {
- $table[] = array(
- $key,
- $var['global_value'],
- $var['local_value'],
- $var['access']
- );
- }
- $columns = array('Variable Name', 'Global Value', 'Local Value', 'Change Permissions');
- table_header('mySQL Variables');
- table_content($columns, $table, '', '', '', '', array('30%', '70%'));
- table_footer();
- unset($table);
- ?>
- <pre>
- PHP_INI_USER | 1 | Entry can be set in user scripts
- PHP_INI_PERDIR | 2 | Entry can be set in php.ini, .htaccess or httpd.conf
- PHP_INI_SYSTEM | 4 | Entry can be set in php.ini or httpd.conf
- PHP_INI_ALL | 7 | Entry can be set anywhere
- </pre>
- <?php
- }
- ############################### MYSQL VARS ###############################
- if ($_REQUEST['do'] == "mysql_vars") {
- admin_header('Server Information', 'mySQL Variables');
- print $nav;
- $result = $db->query('SHOW VARIABLES');
- $colcount = $db->num_fields($result);
- for ($i = 0; $i < $colcount; $i++) {
- $columns[] = $db->field_name($i);
- }
- while ($result = $db->row_array()) {
- for ($i = 0; $i < $colcount; $i++) {
- $tmp[] = $result[$i];
- }
- $table[] = $tmp;
- unset($tmp);
- }
- table_header('mySQL Variables');
- table_content($columns, $table, '', '', '', '', array('30%', '70%'));
- table_footer();
- unset($table);
- }
- ############################### MYSQL STATUS ###############################
- if ($_REQUEST['do'] == "mysql_status") {
- admin_header('Server Information', 'mySQL Status');
- print $nav;
- $result = $db->query('SHOW STATUS');
- $colcount = $db->num_fields($result);
- for ($i = 0; $i < $colcount; $i++) {
- $columns[] = $db->field_name($i);
- }
- while ($result = $db->row_array()) {
- for ($i = 0; $i < $colcount; $i++) {
- $tmp[] = $result[$i];
- }
- $table[] = $tmp;
- unset($tmp);
- }
- table_header('mySQL Status');
- table_content($columns, $table, '', '', '', '', array('50%', '50%'));
- table_footer();
- unset($table);
- }
- ############################### MYSQL STATUS ###############################
- if ($_REQUEST['do'] == "table_status") {
- admin_header('Server Information', 'mySQL Table Status');
- print $nav;
- $result = $db->query('SHOW TABLE STATUS');
- $colcount = $db->num_fields($result);
- for ($i = 0; $i < $colcount; $i++) {
- $columns[] = $db->field_name($i);
- }
- while ($result = $db->row_array()) {
- for ($i = 0; $i < $colcount; $i++) {
- $tmp[] = $result[$i];
- }
- $table[] = $tmp;
- unset($tmp);
- }
- table_header('mySQL Table Status');
- table_content($columns, $table, '', '', '', '', array('50%', '50%'));
- table_footer();
- unset($table);
- }
- ##############################################################
- admin_footer();
- ?>