Strict but sane Error reporting system
authorHarvie <tomas@mudrunka.cz>
Mon, 16 May 2011 04:51:05 +0000 (06:51 +0200)
committerHarvie <tomas@mudrunka.cz>
Mon, 16 May 2011 04:53:25 +0000 (06:53 +0200)
wwwroot/_ajax/ajaxik.php
wwwroot/_ajax/get_children.php
wwwroot/_ajax/get_id_by_name.php
wwwroot/_ajax/get_moods.php
wwwroot/_ajax/get_username_by_id.php
wwwroot/_ajax/testing.php
wwwroot/inc/log.inc
wwwroot/inc/rssparse.php
wwwroot/inc/smarty/node_methodz/function.get_moods.php
wwwroot/nodes.php

index e1eaca7d67df27f57d8acfae6c159bb451f2e013..ea562e4ede569b6e9b760bd0f74f937899ad9f47 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-error_reporting(1);
+error_reporting(E_ALL | E_STRICT);
 session_start();
 require('../config/config.inc');
 require(INCLUDE_DIR.'database.inc');
index 86b69263c7e66ad7a6ccee12d71c3ea9eee1ef69..ed3d98d4be10a30b5224c4b13ee966950f538670 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-error_reporting(1);
+error_reporting(E_ALL | E_STRICT);
 require('../config/config.inc');
 require(INCLUDE_DIR.'database.inc');
 $db=new CLASS_DATABASE();
index b31ea48be976a10fb0e7ed917de1fdcf3e0d21f8..2731b04498d701cddd70b18c06ad2678f7a2825a 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-error_reporting(0);
+error_reporting(E_ALL | E_STRICT);
 require('../config/config.inc');
 require(INCLUDE_DIR.'database.inc');
 $db=new CLASS_DATABASE();
index 03342fab183587c79edc7d85c60517d8e5eeb7cf..928ebc2d58e79e1806eca5cfcc65c63ac6288aca 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-error_reporting(1);
+error_reporting(E_ALL | E_STRICT);
 session_start();
 require('../config/config.inc');
 require(INCLUDE_DIR.'database.inc');
index b31ea48be976a10fb0e7ed917de1fdcf3e0d21f8..2731b04498d701cddd70b18c06ad2678f7a2825a 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-error_reporting(0);
+error_reporting(E_ALL | E_STRICT);
 require('../config/config.inc');
 require(INCLUDE_DIR.'database.inc');
 $db=new CLASS_DATABASE();
index a5d2a1b8602952753c8ca2a9dfa2bec7e5ba5e0f..4473c7c40c8352b1a97d7b55f6140e3dde4e2863 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-error_reporting(1);
+error_reporting(E_ALL | E_STRICT);
 session_start();
 require('../config/config.inc');
 require(INCLUDE_DIR.'database.inc');
index 628bde5c14b54887db5efbfb2eb555164be4c85e..994ce4de3bf20e245810788f0b337ecb1996d8ef 100644 (file)
@@ -1,6 +1,10 @@
 <?php
 class logger {
 
+       public static function error_handler($errno=-1, $errstr='unknown', $errfile='/dev/null', $errline=-1, $errcontext=array('?')) {
+               return error_log("$errfile:$errline = error #$errno: $errstr");
+       }
+
        public static function log($action,$node_id,$result,$parameter1='',$parameter2='') {
 
                global $db,$node;
@@ -12,4 +16,3 @@ class logger {
        }
 
 }
-?>
index 5d342a8bd67e1de04c9e129d33225a679bd272a0..7af7df0240e4f8543b8d12a08ad96e342a7ea9b6 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-error_reporting(0);
 // include lastRSS library
 include './lastRSS.php';
 
index 006f85f29e0cb14d6ddfeca77adee594799cb26a..5d35ea045e4897ead0c495f73a4c4cf2c0b81427 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 function smarty_function_get_moods($params,&$smarty) {
        global $db;
-error_reporting(1);
        $user_id = $params['user_id'];
        $set = $db->query(sprintf('select moods from users where user_id = %d', $user_id));
        $set->next();
@@ -38,4 +37,4 @@ error_reporting(1);
        $smarty->assign('get_moods_string',$moods_string);
        $smarty->assign('get_moods_mood',$mood);
 }
-?>
\ No newline at end of file
+?>
index 8b9edaade48e867165231eb5464b472d3aa8ee6a..5b9a9a3b2126639fa67a60b7b1bfa4781bdf17cd 100644 (file)
@@ -81,20 +81,21 @@ if (!empty($_GET['template_id'])) {
        $template_id=false;
 }
 
-error_reporting(1);
+error_reporting(E_ALL | E_STRICT);
 //$_SESSION['debugging']=0;
 //unset($_SESSION['debugging']); 
 //Well... we should make some event 
 //or JavaScript page to turning this on/off...
 //exit;
-if ($_SESSION['debugging']) {
-    error_reporting(E_ALL);
+if(isset($_SESSION['debugging']) && $_SESSION['debugging']) {
     echo 'GET VARIABLES::<br/>';
     print_r($_GET);
     echo 'POST VARIABLES::<br/>';
     print_r($_POST);
     echo '<b>SESSION VARIABLES::</b><br/>';
     print_r($_SESSION);
+} else {
+       set_error_handler('logger::error_handler');
 }
 
 require_once(INCLUDE_DIR.'logout_idle.inc'); //Logout when idle
This page took 0.30959 seconds and 4 git commands to generate.