28-07-2011, 08:14
|
|
|
חבר מתאריך: 25.08.03
הודעות: 9,114
|
|
דוגמה לפונקציה שכתבתי והשתמשתי בעבר:
קוד PHP:
function ErrorHandler($number, $description, $file, $line){
if(error_reporting() & $number)
error($description, $file, $line, NULL);
else{
if(in_array($number, array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, E_USER_DEPRECATED)))
echo error($description, $file, $line, NULL, true);
return false;
}
}
$old_error_handler = set_error_handler('ErrorHandler');
כמובן שכדאי להוסיף אפשרות של כתיבת קובץ יומן וכדומה.
נערך לאחרונה ע"י ישראל K בתאריך 28-07-2011 בשעה 08:25.
|