From 5c888162b89be2bcc18986e11f4f9e11d9421fbf Mon Sep 17 00:00:00 2001 From: rojaro <> Date: Sun, 1 Nov 2009 20:36:03 +0000 Subject: fixed error handler to detect changes in the error reporting level after initialisation as suggested by acron in http://www.pradosoft.com/forum/index.php?topic=12226.0 --- framework/PradoBase.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'framework') diff --git a/framework/PradoBase.php b/framework/PradoBase.php index 3bf747df..1819b72f 100644 --- a/framework/PradoBase.php +++ b/framework/PradoBase.php @@ -71,7 +71,7 @@ class PradoBase */ public static function getVersion() { - return '3.2-dev'; + return '3.2-dev'; } /** @@ -84,7 +84,7 @@ class PradoBase /** * Sets error handler to be Prado::phpErrorHandler */ - set_error_handler(array('PradoBase','phpErrorHandler'),error_reporting()); + set_error_handler(array('PradoBase','phpErrorHandler')); /** * Sets exception handler to be Prado::exceptionHandler */ @@ -132,7 +132,7 @@ class PradoBase */ public static function phpErrorHandler($errno,$errstr,$errfile,$errline) { - if(error_reporting()!=0) + if(error_reporting() & $errno) throw new TPhpErrorException($errno,$errstr,$errfile,$errline); } @@ -639,5 +639,3 @@ class TReflectionClass extends ReflectionClass PradoBase::using('System.TComponent'); PradoBase::using('System.Exceptions.TException'); PradoBase::using('System.Util.TLogger'); - -?> -- cgit v1.2.3