debugging(): use trigger_error() when !display_errors -- now you can debug stuff without breaking HTTP headers, HTML and JS

This commit is contained in:
martinlanghoff 2006-12-21 02:51:20 +00:00
parent d5afb8cb59
commit c7533061ef

View File

@ -5478,7 +5478,13 @@ function debugging($message='', $level=DEBUG_NORMAL) {
if ($CFG->debug >= $level) {
if ($message) {
notify($message, 'notifytiny');
if (ini_get('display_errors') == true) {
notify($message, 'notifytiny');
} else {
// moodle debug levels constants map well to PHP's own
trigger_error($message, $level);
}
}
return true;
}