]> granicus.if.org Git - php/commitdiff
@- Fixed a (fairly common) situation where error_reporting values would not be
authorZeev Suraski <zeev@php.net>
Sat, 26 Feb 2000 23:50:11 +0000 (23:50 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 26 Feb 2000 23:50:11 +0000 (23:50 +0000)
@  properly restored after a call to error_reporting(), in between requests (Zeev)

main/main.c
main/php_globals.h

index be0084e7f46f205b6a43b41e98131da46bb3c38f..3978987b9f43f412d73e87449ab6084c9cdcde3d 100644 (file)
@@ -133,13 +133,15 @@ static PHP_INI_MH(OnChangeMemoryLimit)
 
 static PHP_INI_MH(OnUpdateErrorReporting)
 {
+       PLS_FETCH();
        ELS_FETCH();
 
        if (!new_value) {
-               EG(error_reporting) = E_ALL & ~E_NOTICE;
+               PG(error_reporting) = E_ALL & ~E_NOTICE;
        } else {
-               EG(error_reporting) = atoi(new_value);
+               PG(error_reporting) = atoi(new_value);
        }
+       EG(error_reporting) = PG(error_reporting);
        return SUCCESS;
 }
 
@@ -656,6 +658,7 @@ void php_request_shutdown(void *dummy)
        php_call_shutdown_functions();
        
        php_ini_rshutdown();
+       EG(error_reporting) = PG(error_reporting);
 
        zend_deactivate(CLS_C ELS_CC);
        sapi_deactivate(SLS_C);
index 1c50a7c1beadfdf189675f89d5af34015005ac3d..67e1946dd9a985cfa1b65bae778a7b622e271844 100644 (file)
@@ -72,6 +72,7 @@ struct _php_core_globals {
 
        long memory_limit;
 
+       int error_reporting;
        zend_bool track_errors;
        zend_bool display_errors;
        zend_bool log_errors;