colder          Sat Mar  8 22:12:32 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/standard/tests/general_functions       bug44295.phpt 

  Modified files:              
    /php-src/main       main.c php.h php_globals.h 
  Log:
  MFH: User error handlers no longer catch supressed errors
  
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.57.2.11&r2=1.640.2.23.2.57.2.12&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.23.2.57.2.11 
php-src/main/main.c:1.640.2.23.2.57.2.12
--- php-src/main/main.c:1.640.2.23.2.57.2.11    Wed Mar  5 13:34:12 2008
+++ php-src/main/main.c Sat Mar  8 22:12:32 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.640.2.23.2.57.2.11 2008/03/05 13:34:12 dmitry Exp $ */
+/* $Id: main.c,v 1.640.2.23.2.57.2.12 2008/03/08 22:12:32 colder Exp $ */
 
 /* {{{ includes
  */
@@ -778,17 +778,15 @@
 /* {{{ php_suppress_errors */
 PHPAPI void php_set_error_handling(error_handling_t error_handling, 
zend_class_entry *exception_class TSRMLS_DC)
 {
-       PG(error_handling) = error_handling;
-       PG(exception_class) = exception_class;
-       if (PG(last_error_message)) {
-               free(PG(last_error_message));
-               PG(last_error_message) = NULL;
-       }
-       if (PG(last_error_file)) {
-               free(PG(last_error_file));
-               PG(last_error_file) = NULL;
+       EG(error_handling) = error_handling;
+       EG(exception_class) = exception_class;
+
+       if (error_handling == EH_NORMAL) {
+               EG(user_error_handler)     = EG(user_error_handler_old);
+       } else {
+               EG(user_error_handler_old) = EG(user_error_handler);
+               EG(user_error_handler)     = NULL;
        }
-       PG(last_error_lineno) = 0;
 }
 /* }}} */
 
@@ -833,7 +831,7 @@
        }
 
        /* according to error handling mode, suppress error, throw exception or 
show it */
-       if (PG(error_handling) != EH_NORMAL) {
+       if (EG(error_handling) != EH_NORMAL) {
                switch (type) {
                        case E_ERROR:
                        case E_CORE_ERROR:
@@ -854,8 +852,8 @@
                                /* throw an exception if we are in EH_THROW mode
                                 * but DO NOT overwrite a pending exception
                                 */
-                               if (PG(error_handling) == EH_THROW && 
!EG(exception)) {
-                                       
zend_throw_error_exception(PG(exception_class), buffer, 0, type TSRMLS_CC);
+                               if (EG(error_handling) == EH_THROW && 
!EG(exception)) {
+                                       
zend_throw_error_exception(EG(exception_class), buffer, 0, type TSRMLS_CC);
                                }
                                efree(buffer);
                                return;
@@ -1729,7 +1727,8 @@
        PG(last_error_message) = NULL;
        PG(last_error_file) = NULL;
        PG(last_error_lineno) = 0;
-       PG(error_handling) = EH_NORMAL;
+       EG(error_handling)  = EH_NORMAL;
+       EG(exception_class) = NULL;
        PG(disable_functions) = NULL;
        PG(disable_classes) = NULL;
 
http://cvs.php.net/viewvc.cgi/php-src/main/php.h?r1=1.221.2.4.2.8.2.3&r2=1.221.2.4.2.8.2.4&diff_format=u
Index: php-src/main/php.h
diff -u php-src/main/php.h:1.221.2.4.2.8.2.3 
php-src/main/php.h:1.221.2.4.2.8.2.4
--- php-src/main/php.h:1.221.2.4.2.8.2.3        Wed Jan 30 09:41:12 2008
+++ php-src/main/php.h  Sat Mar  8 22:12:32 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php.h,v 1.221.2.4.2.8.2.3 2008/01/30 09:41:12 dmitry Exp $ */
+/* $Id: php.h,v 1.221.2.4.2.8.2.4 2008/03/08 22:12:32 colder Exp $ */
 
 #ifndef PHP_H
 #define PHP_H
@@ -278,12 +278,7 @@
 END_EXTERN_C()
 
 #define php_error zend_error
-
-typedef enum {
-       EH_NORMAL = 0,
-       EH_SUPPRESS,
-       EH_THROW
-} error_handling_t;
+#define error_handling_t zend_error_handling_t
 
 BEGIN_EXTERN_C()
 PHPAPI void php_set_error_handling(error_handling_t error_handling, 
zend_class_entry *exception_class TSRMLS_DC);
http://cvs.php.net/viewvc.cgi/php-src/main/php_globals.h?r1=1.98.2.1.2.7.2.2&r2=1.98.2.1.2.7.2.3&diff_format=u
Index: php-src/main/php_globals.h
diff -u php-src/main/php_globals.h:1.98.2.1.2.7.2.2 
php-src/main/php_globals.h:1.98.2.1.2.7.2.3
--- php-src/main/php_globals.h:1.98.2.1.2.7.2.2 Mon Dec 31 07:17:17 2007
+++ php-src/main/php_globals.h  Sat Mar  8 22:12:32 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_globals.h,v 1.98.2.1.2.7.2.2 2007/12/31 07:17:17 sebastian Exp $ */
+/* $Id: php_globals.h,v 1.98.2.1.2.7.2.3 2008/03/08 22:12:32 colder Exp $ */
 
 #ifndef PHP_GLOBALS_H
 #define PHP_GLOBALS_H
@@ -150,8 +150,6 @@
        char *last_error_message;
        char *last_error_file;
        int  last_error_lineno;
-       error_handling_t  error_handling;
-       zend_class_entry *exception_class;
 
        char *disable_functions;
        char *disable_classes;

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug44295.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/bug44295.phpt
+++ php-src/ext/standard/tests/general_functions/bug44295.phpt



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to