no more PG(error_handling) in PHP-5.3
authorMichael Wallner <mike@php.net>
Wed, 12 Mar 2008 07:46:32 +0000 (07:46 +0000)
committerMichael Wallner <mike@php.net>
Wed, 12 Mar 2008 07:46:32 +0000 (07:46 +0000)
http_api.c
missing.h
php_http_std_defs.h

index 4ab7d7edbd1862d4eb6b2ab41ef7eb0666907717..77b11348c0a0bfc484d3120de9dcb2b1a08ab12b 100644 (file)
@@ -109,7 +109,7 @@ void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...)
        
        va_start(args, format);
 #ifdef ZEND_ENGINE_2
-       if ((type == E_THROW) || (PG(error_handling) == EH_THROW)) {
+       if ((type == E_THROW) || (GLOBAL_ERROR_HANDLING == EH_THROW)) {
                char *message;
                zend_class_entry *ce = http_exception_get_for_code(code);
                
@@ -117,7 +117,7 @@ void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...)
                        vspprintf(&message, 0, format, args);
                        zend_throw_exception(ce, message, code TSRMLS_CC);
                        efree(message);
-               } http_catch(PG(exception_class) ? PG(exception_class) : HTTP_EX_DEF_CE);
+               } http_catch(GLOBAL_EXCEPTION_CLASS ? GLOBAL_EXCEPTION_CLASS : HTTP_EX_DEF_CE);
        } else
 #endif
        php_verror(NULL, "", type, format, args TSRMLS_CC);
index 703f2b168df4be90cae6a24df486d6285a02fd94..edc3af0f7f108f506028857edf55b0ec330d63af 100644 (file)
--- a/missing.h
+++ b/missing.h
 
 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 3)
 #      define HTTP_ZAPI_CONST_CAST(t) (const t)
+#      define GLOBAL_ERROR_HANDLING EG(error_handling)
+#      define GLOBAL_EXCEPTION_CLASS EG(exception_class)
 #else
 #      define HTTP_ZAPI_CONST_CAST(t) (t)
+#      define GLOBAL_ERROR_HANDLING PG(error_handling)
+#      define GLOBAL_EXCEPTION_CLASS PG(exception_class)
 #endif
 
 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION == 0)
index d20579d8b025ca9618e3d73ea9aee3536018d3f4..fdbfafa5e4e4b0a5915f6851e067ddae2a0e004f 100644 (file)
@@ -219,8 +219,8 @@ typedef int STATUS;
 #ifdef ZEND_ENGINE_2
 #      define with_error_handling(eh, ec) \
        { \
-               error_handling_t __eh = PG(error_handling); \
-               zend_class_entry *__ec= PG(exception_class); \
+               error_handling_t __eh = GLOBAL_ERROR_HANDLING; \
+               zend_class_entry *__ec= GLOBAL_EXCEPTION_CLASS; \
                php_set_error_handling(eh, ec TSRMLS_CC);
 #      define end_error_handling() \
                php_set_error_handling(__eh, __ec TSRMLS_CC); \