diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-21 07:33:35 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-21 07:33:35 +0000 |
commit | 71f0c05034660f97f92b07f3c39295c861427a47 (patch) | |
tree | 82ef87b76013995d1c9e882f01799d4eb8cef068 | |
parent | 42f1115c2ed920d9624f73b64d9c5e1c0df675b2 (diff) | |
download | ampache-71f0c05034660f97f92b07f3c39295c861427a47.tar.gz ampache-71f0c05034660f97f92b07f3c39295c861427a47.tar.bz2 ampache-71f0c05034660f97f92b07f3c39295c861427a47.zip |
fixed the debug page
-rw-r--r-- | lib/debug.lib.php | 57 | ||||
-rw-r--r-- | templates/show_test.inc.php (renamed from templates/show_test.inc) | 6 | ||||
-rw-r--r-- | test.php | 7 |
3 files changed, 38 insertions, 32 deletions
diff --git a/lib/debug.lib.php b/lib/debug.lib.php index 9f7f1c59..b2969815 100644 --- a/lib/debug.lib.php +++ b/lib/debug.lib.php @@ -47,22 +47,21 @@ function check_database($host,$username,$pass) { } // check_database -/*! - @function check_database_inserted - @discussion checks to make sure that you - have inserted the database and that the user - you are using has access to it -*/ +/** + * check_database_inserted + * checks to make sure that you have inserted the database + * and that the user you are using has access to it + */ function check_database_inserted($dbh,$db_name) { + $sql = "DESCRIBE session"; + $db_results = Dba::query($sql); - if (!@mysql_select_db($db_name,$dbh)) { - return false; - } + if (!$db_results) { + return false; + } - $sql = "DESCRIBE session"; - $db_results = @mysql_query($sql, $dbh); - if (!@mysql_num_rows($db_results)) { + if (!Dba::num_rows($db_results)) { return false; } @@ -70,11 +69,11 @@ function check_database_inserted($dbh,$db_name) { } // check_database_inserted -/*! - @function check_php_ver - @discussion checks the php version and makes - sure that it's good enough -*/ +/** + * check_php_ver + * checks the php version and makes + * sure that it's good enough + */ function check_php_ver($level=0) { if (strcmp('5.0.0',phpversion()) > 0) { @@ -85,10 +84,10 @@ function check_php_ver($level=0) { } // check_php_ver -/*! - @function check_php_mysql - @discussion checks for mysql support -*/ +/** + * check_php_mysql + * checks for mysql support by looking for the mysql_query function + */ function check_php_mysql() { if (!function_exists('mysql_query')) { @@ -99,10 +98,10 @@ function check_php_mysql() { } // check_php_mysql -/*! - @function check_php_session - @discussion checks to make sure the needed functions - for sessions exist +/** + * check_php_session + * checks to make sure the needed functions + * for sessions exist */ function check_php_session() { @@ -114,10 +113,10 @@ function check_php_session() { } // check_php_session -/*! - @function check_php_iconv - @discussion checks to see if you have iconv installed -*/ +/** + * check_php_iconv + * checks to see if you have iconv installed + */ function check_php_iconv() { if (!function_exists('iconv')) { diff --git a/templates/show_test.inc b/templates/show_test.inc.php index 2ae2d10e..d7ddefe7 100644 --- a/templates/show_test.inc +++ b/templates/show_test.inc.php @@ -174,10 +174,12 @@ <td valign="top">[ <?php $results = @parse_ini_file($configfile); + Config::set_by_array($results); if (!check_config_values($results)) { echo " <font color=\"red\">ERROR</font> "; } else { + $status['parse_config'] = true; echo " <font color=\"green\"> OK </font> "; } ?> @@ -242,9 +244,9 @@ else { $http_type = "http://"; } - $results['web_path'] = $http_type . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . $results['web_path']; + $results['web_path'] = $http_type . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . Config::get('web_path'); if ($status['parse_config']) { - echo "<img src=\"" . $results['web_path'] ."/images/ampache.gif\" width=\"80\" height=\"15\"/>"; + echo "<img src=\"" . $results['web_path'] ."/images/ampache.png\" width=\"80\" height=\"15\"/>"; } else { $status['check_webpath'] = false; @@ -27,17 +27,22 @@ $prefix = dirname(__FILE__); $configfile = "$prefix/config/ampache.cfg.php"; $row_classes = array('even','odd'); +define('INIT_LOADED','1'); require_once $prefix . '/lib/general.lib.php'; +require_once $prefix . '/lib/log.lib.php'; +require_once $prefix . '/lib/class/config.class.php'; +require_once $prefix . '/lib/class/dba.class.php'; require_once $prefix . '/lib/ui.lib.php'; require_once $prefix . '/lib/class/error.class.php'; require_once $prefix . '/lib/class/config.class.php'; require_once $prefix . '/lib/debug.lib.php'; +Dba::_auto_init(); switch ($_REQUEST['action']) { default: - require_once $prefix . '/templates/show_test.inc'; + require_once $prefix . '/templates/show_test.inc.php'; break; } // end switch on action |