diff options
Diffstat (limited to 'main')
| -rw-r--r-- | main/configuration-parser.y | 18 | ||||
| -rw-r--r-- | main/configuration-scanner.l | 11 | ||||
| -rw-r--r-- | main/main.c | 11 | ||||
| -rw-r--r-- | main/php_globals.h | 1 |
4 files changed, 36 insertions, 5 deletions
diff --git a/main/configuration-parser.y b/main/configuration-parser.y index d5ca601051..a2ea934bb1 100644 --- a/main/configuration-parser.y +++ b/main/configuration-parser.y @@ -348,6 +348,8 @@ static void convert_browscap_pattern(pval *pattern) %token EXTENSION %token T_ZEND_EXTENSION %token T_ZEND_EXTENSION_TS +%token T_ZEND_EXTENSION_DEBUG +%token T_ZEND_EXTENSION_DEBUG_TS %% @@ -380,13 +382,25 @@ statement: php3_dl(&$3,MODULE_PERSISTENT,&dummy); } | T_ZEND_EXTENSION '=' string { -#ifndef ZTS +#if !defined(ZTS) && !defined(ZEND_DEBUG) zend_load_extension($3.value.str.val); #endif free($3.value.str.val); } | T_ZEND_EXTENSION_TS '=' string { -#ifdef ZTS +#if defined(ZTS) && !defined(ZEND_DEBUG) + zend_load_extension($3.value.str.val); +#endif + free($3.value.str.val); + } + | T_ZEND_EXTENSION_DEBUG '=' string { +#if !defined(ZTS) && defined(ZEND_DEBUG) + zend_load_extension($3.value.str.val); +#endif + free($3.value.str.val); + } + | T_ZEND_EXTENSION_DEBUG_TS '=' string { +#if defined(ZTS) && defined(ZEND_DEBUG) zend_load_extension($3.value.str.val); #endif free($3.value.str.val); diff --git a/main/configuration-scanner.l b/main/configuration-scanner.l index 709fbbbe64..e72a1c6ee9 100644 --- a/main/configuration-scanner.l +++ b/main/configuration-scanner.l @@ -64,6 +64,17 @@ void init_cfg_scanner() return T_ZEND_EXTENSION_TS; } + +<INITIAL>"zend_extension_debug" { + return T_ZEND_EXTENSION_DEBUG; +} + + +<INITIAL>"zend_extension_debug_ts" { + return T_ZEND_EXTENSION_DEBUG_TS; +} + + <INITIAL>[ ]*("true"|"on"|"yes")[ ]* { cfglval->value.str.val = php3_strndup("1",1); cfglval->value.str.len = 1; diff --git a/main/main.c b/main/main.c index 549a9da0c9..f2c4e589b0 100644 --- a/main/main.c +++ b/main/main.c @@ -597,8 +597,10 @@ static void php_message_handler_for_zend(long message, void *data) -int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC) +int php_request_startup(CLS_D ELS_DC PLS_DC) { + PG(unclean_shutdown) = 0; + zend_output_startup(); php3_set_timeout(PG(max_execution_time)); @@ -629,7 +631,6 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC) init_compiler(CLS_C ELS_CC); init_executor(CLS_C ELS_CC); - startup_scanner(CLS_C); @@ -659,6 +660,7 @@ void php_request_shutdown(void *dummy) #endif CLS_FETCH(); ELS_FETCH(); + PLS_FETCH(); php3_header(); zend_end_ob_buffering(1); @@ -673,7 +675,7 @@ void php_request_shutdown(void *dummy) shutdown_executor(ELS_C); php3_destroy_request_info(NULL); - shutdown_memory_manager(0, 0); + shutdown_memory_manager(PG(unclean_shutdown), 0); php3_unset_timeout(); @@ -1130,6 +1132,7 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_ } if (setjmp(EG(bailout))!=0) { + PG(unclean_shutdown) = 1; return; } _php3_hash_environment(PLS_C); @@ -1156,6 +1159,8 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_ if (EG(main_op_array)) { EG(active_op_array) = EG(main_op_array); zend_execute(EG(main_op_array) ELS_CC); + } else { + PG(unclean_shutdown) = 1; } } diff --git a/main/php_globals.h b/main/php_globals.h index ce5405c930..48ad5441f7 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -65,6 +65,7 @@ struct _php_core_globals { long y2k_compliance; unsigned char header_is_being_sent; + unsigned char unclean_shutdown; }; |
