Code

Udpated server category
[gosa.git] / include / php_setup.inc
index 8676ae819630db7444a5a630f476cf333b823666..ec13459435faafcdfcb6492c3f538883d69db13b 100644 (file)
@@ -22,6 +22,10 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
 {
   global $error_collector,$config;
 
+  if(@class_exists("log")){
+    new log("debug","all",$errfile,array(),"Type:".$errno.", Message:".$errstr.", File:".$errfile.", Line: ".$errline);
+  }
+
   /* Return if error reporting is set to zero */
   if (error_reporting() == 0){
     return;
@@ -57,7 +61,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
     if((isset($config->data['MAIN']['DISPLAYERRORS']))&&(!preg_match("/^true$/i",$config->data['MAIN']['DISPLAYERRORS']))){
 
       /* Write to syslog */
-      gosa_log ("PHP error: $errstr ($errfile, line $errline)");
+      new log("view","error","",array(),"PHP error: $errstr ($errfile, line $errline)");
       return;
     }
   }
@@ -68,7 +72,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
     if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){
       $error_collector= "<div>";
     } else {
-      $error_collector= "<table summary=\"\" width=\"100%\" style='background-color:#E0E0E0;border-bottom:1px solid black'><tr><td><img alt=\"\" align=\"middle\" src='".get_template_path('images/warning.png')."'>&nbsp;<font style='font-size:14px;font-weight:bold'>"._("Generating this page caused the PHP interpreter to raise some errors!")."</font></td><td align=right><button onClick='toggle(\"errorbox\")'>"._("Toggle information")."</button></td></tr></table><div id='errorbox' style='position:absolute; z-index:0; visibility: hidden'>";
+      $error_collector= "<table summary=\"\" width=\"100%\" style='background-color:#E0E0E0;border-bottom:1px solid black;z-index:150;'><tr><td><img alt=\"\" align=\"middle\" src='".get_template_path('images/warning.png')."'>&nbsp;<font style='font-size:14px;font-weight:bold'>"._("Generating this page caused the PHP interpreter to raise some errors!")."</font></td><td align=right><button onClick='toggle(\"errorbox\")'>"._("Toggle information")."</button></td></tr></table><div id='errorbox' style='position:absolute; z-index:150; visibility: hidden'>";
     }
   }
  
@@ -108,6 +112,12 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
       $args= "";
       if (isset($ct['args'])){
         foreach ($ct['args'] as $arg){
+       
+          /* Avoid convertig object to string errors */ 
+          if(is_object($arg)){
+            $arg = "CLASS:&nbsp;".get_class($arg);
+          }
+  
           $args.= htmlentities("\"$arg\", ");
         }
       }