file = $file; $this->line = $line; $this->errContext = $context; } function __toString () { $retStr = "Laufzeitfehler (" . $this->code . "): \n"; $retStr .= $this->message . "\n\n"; $retStr .= 'Datei: ' . $this->file . "\n"; $retStr .= 'Zeile: ' . $this->line . "\n"; if ($this->errContext != NULL) { $retStr .= "Fehler Context: \n"; $retStr .= print_r ($this->errContext, TRUE) . "\n"; } $retStr .= "Aufruf Stack: \n"; $retStr .= $this->getTraceAsString () . "\n"; return $retStr; } function getErrContext () { return $this->errContext; } } function mapErrToExc ($no, $msg, $file, $line, $con) { throw new errException ($msg, $no, $file, $line, $con); } function setErrExceptionMapping () { global $oldErrHandler; if ($oldErrHandler == NULL) $oldErrHandler = set_error_handler ('mapErrToExc'); } function resetErrExceptionMapping () { global $oldErrHandler; if ($oldErrHandler != NULL) { set_error_handler ($oldErrHandler); $oldErrHandler = NULL; } } ?>