diff --git a/html/css/styles.css b/html/css/styles.css index 93711ced1..b0ed86172 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -1600,3 +1600,6 @@ tr.search:nth-child(odd) { font-size: 2.5em; } +.navbar-debug { + min-height: 25px; +} diff --git a/html/includes/print-debug.php b/html/includes/print-debug.php new file mode 100644 index 000000000..5c23a3536 --- /dev/null +++ b/html/includes/print-debug.php @@ -0,0 +1,89 @@ + + +
+ + diff --git a/html/index.php b/html/index.php index b8ffaacd4..353bbc7cc 100755 --- a/html/index.php +++ b/html/index.php @@ -12,6 +12,38 @@ * */ +$_SERVER['PATH_INFO'] = (isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : $_SERVER['ORIG_PATH_INFO']); + +function logErrors($errno, $errstr, $errfile, $errline) { + global $php_debug; + $php_debug[] = array('errno' => $errno, 'errstr' => $errstr, 'errfile' => $errfile, 'errline' => $errline); +} + +function catchFatal() { + $last_error = error_get_last(); + if ($last_error['type'] == 1) { + $log_error = array($last_error['type'],$last_error['message'],$last_error['file'],$last_error['line']); + print_r($log_error); + } +} + +if (strpos($_SERVER['PATH_INFO'], "debug")) +{ + $debug = "1"; + ini_set('display_errors', 0); + ini_set('display_startup_errors', 1); + ini_set('log_errors', 1); + ini_set('error_reporting', E_ALL); + set_error_handler('logErrors'); + register_shutdown_function('catchFatal'); +} else { + $debug = FALSE; + ini_set('display_errors', 0); + ini_set('display_startup_errors', 0); + ini_set('log_errors', 0); + ini_set('error_reporting', 0); +} + // Set variables $msg_box = array(); @@ -38,23 +70,6 @@ ob_start(); ini_set('allow_url_fopen', 0); ini_set('display_errors', 0); -$_SERVER['PATH_INFO'] = (isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : $_SERVER['ORIG_PATH_INFO']); - -if (strpos($_SERVER['PATH_INFO'], "debug")) -{ - $debug = "1"; - ini_set('display_errors', 1); - ini_set('display_startup_errors', 1); - ini_set('log_errors', 1); - ini_set('error_reporting', E_ALL); -} else { - $debug = FALSE; - ini_set('display_errors', 0); - ini_set('display_startup_errors', 0); - ini_set('log_errors', 0); - ini_set('error_reporting', 0); -} - foreach ($_GET as $key=>$get_var) { if (strstr($key, "opt")) @@ -318,6 +333,13 @@ toastr.options.extendedTimeOut = 20; echo(""); } +if (is_array($sql_debug) && is_array($php_debug)) { + + include_once "includes/print-debug.php"; + +} + ?> +