X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=main.php;h=35a257b8171ecd64d67867fdd8c751524281372d;hp=8361b2833a1bdb4c74b62b003b8d8d907d559ffe;hb=db4efc501d78e76da03e2a87513f3e18ee627978;hpb=811bc0c7a1f583fb624a0f8c3601146e063c5a25 diff --git a/main.php b/main.php index 8361b28..35a257b 100644 --- a/main.php +++ b/main.php @@ -6,7 +6,7 @@ * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * - * * + * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * @@ -16,7 +16,7 @@ * along with this program. If not, see . * * * ************************************************************************ - * + * * 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