added errorhandler
[PHP-P10.git] / main.php
index a6b615a9947a42afc399649a7aea1e3c001ab72e..35a257b8171ecd64d67867fdd8c751524281372d 100644 (file)
--- 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");