From: NurPech Date: Mon, 10 Jun 2013 19:31:13 +0000 (+0200) Subject: added errorhandler X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=commitdiff_plain;h=29eef077dac1cafd25b8660d04dbbe634127d321 added errorhandler --- diff --git a/main.php b/main.php index a6b615a..35a257b 100644 --- a/main.php +++ b/main.php @@ -36,6 +36,31 @@ if(function_exists("pcntl_signal")) { pcntl_signal(SIGTERM, 'shutdown'); } +function myErrorHandler($errorcode, $errortext, $errorfile, $errorline) +{ + switch ($errorcode) { + case E_USER_ERROR: + echo $errorcode.': '.$errortext.' in '.$errorfile.' Line '.$errorline; + break; + + case E_USER_WARNING: + echo $errorcode.': '.$errortext.' in '.$errorfile.' Line '.$errorline; + break; + + case E_USER_NOTICE: + echo $errorcode.': '.$errortext.' in '.$errorfile.' Line '.$errorline; + break; + + default: + echo $errorcode.': '.$errortext.' in '.$errorfile.' Line '.$errorline; + break; + } + + return true; +} + +$error_handler = set_error_handler("myErrorHandler"); + //basicly here is nothing, yet :D $uplink = new Uplink(); require_once("config.inc.php");