<?php/*************************************************************************** * @file ErrorHandler.class.php * @version 0.0.1 * * @author (Programmer) Miguel Pinto AKA Lookatitude * @since Moday, 22th of September of 2006 * * @copyright 2006 (c) TuxOSP - Tux OpenSource Projects, Portugal * @link http://xmanager.tuxosp.org/ Tux OpenSource Projects, Portugal * * @todo * 1. Develop debug erros functions. * * {@internal * *** * * CHANGELOG: * *** * } ***************************************************************************//*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/defined('_VALID_INCLUDE') or die();class Error_handler { // set the user error handler method to be error_handler set_error_handler('error_handler', E_ALL); // error handler function public function error_handler($errNo, $errStr, $errFile, $errLine) { // clear any output that has already been generated if(ob_get_length()) ob_clean(); // output the error message $error_message = 'ERRNO: ' . $errNo . chr(10) . 'TEXT: ' . $errStr . chr(10) . 'LOCATION: ' . $errFile . ', line ' . $errLine; echo $error_message; // prevent processing any more PHP scripts exit; }}?>