X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=main.php;h=35a257b8171ecd64d67867fdd8c751524281372d;hp=7ea2ed4b62ead5bbfd1f389b247a3a8aed4fe25e;hb=refs%2Fheads%2Fmaster;hpb=ddffd103502359153b425495e8834ebcb1e157f0 diff --git a/main.php b/main.php index 7ea2ed4..35a257b 100644 --- a/main.php +++ b/main.php @@ -1,12 +1,12 @@ . * * * ************************************************************************ - * + * * main.php * * initial php file @@ -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"); @@ -63,7 +88,7 @@ while(true) { $botloader->loop(); timer_loop(); if(function_exists("pcntl_signal_dispatch")) - pcntl_signal_dispatch(); + pcntl_signal_dispatch(); } ?> \ No newline at end of file