1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 05:37:32 +02:00

Little debug fix

This commit is contained in:
CaMer0n
2009-07-21 14:20:13 +00:00
parent c6ad7fc42f
commit d1cdf20899
2 changed files with 26 additions and 17 deletions

View File

@@ -9,9 +9,9 @@
* General purpose file * General purpose file
* *
* $Source: /cvs_backup/e107_0.8/class2.php,v $ * $Source: /cvs_backup/e107_0.8/class2.php,v $
* $Revision: 1.110 $ * $Revision: 1.111 $
* $Date: 2009-07-19 11:44:26 $ * $Date: 2009-07-21 14:20:12 $
* $Author: marj_nl_fr $ * $Author: e107coders $
* *
*/ */
// //
@@ -1999,10 +1999,10 @@ class error_handler
return; return;
} }
if ((isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'debug=') !== FALSE) || isset($_COOKIE['e107_debug_level'])) if ((isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'debug=') !== FALSE) || isset($_COOKIE['e107_debug_level']) && strpos($_SERVER['QUERY_STRING'], 'debug=-') !== TRUE )
{ {
$this->debug = true; $this->debug = true;
error_reporting(E_ALL); error_reporting(E_ALL);
} }
else else
{ {
@@ -2054,7 +2054,8 @@ class error_handler
function return_errors() function return_errors()
{ {
$index = 0; $colours[0] = "#C1C1C1"; $colours[1] = "#B6B6B6"; $index = 0; $colours[0] = "#C1C1C1"; $colours[1] = "#B6B6B6";
$ret = "<table class='fborder'>\n"; $ret = "";
if (E107_DBG_ERRBACKTRACE) if (E107_DBG_ERRBACKTRACE)
{ {
foreach ($this->errors as $key => $value) foreach ($this->errors as $key => $value)
@@ -2071,8 +2072,8 @@ class error_handler
$ret .= "<tr class='forumheader3'><td>{$value['short']}</td></tr>\n"; $ret .= "<tr class='forumheader3'><td>{$value['short']}</td></tr>\n";
} }
} }
$ret .= '</table>';
return $ret; return ($ret) ? "<table class='fborder'>\n".$ret."</table>" : FALSE;
} }
function trigger_error($information, $level) function trigger_error($information, $level)

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/db_debug_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/db_debug_class.php,v $
| $Revision: 1.10 $ | $Revision: 1.11 $
| $Date: 2009-07-12 02:29:24 $ | $Date: 2009-07-21 14:20:13 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -625,13 +625,21 @@ global $error_handler,$e107_Clean_Exit,$In_e107_Footer,$ADMIN_DIRECTORY;
while (ob_get_level() > 0) { while (ob_get_level() > 0) {
ob_end_flush(); ob_end_flush();
} }
if (isset($error_handler))
{ if (isset($error_handler) )
echo "<br /><div 'e107_debug php_err'><h3>PHP Errors:</h3><br />".$error_handler->return_errors()."</div>\n"; {
} else { if($error_handler->return_errors())
echo "<b>e107 Shutdown while no error_handler available!</b>"; {
echo "<br /><div 'e107_debug php_err'><h3>PHP Errors:</h3><br />".$error_handler->return_errors()."</div>\n";
echo "</body></html>";
}
} }
echo "</body></html>"; else
{
echo "<b>e107 Shutdown while no error_handler available!</b>";
echo "</body></html>";
}
} }
?> ?>