diff options
| author | Zeev Suraski <zeev@php.net> | 2001-08-08 20:05:37 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2001-08-08 20:05:37 +0000 |
| commit | f47962c7c09bb9c9bb7a7acc767b45dbd1b6489d (patch) | |
| tree | c3e727f56f1244db780498e4292121c9e526ebbc /main/main.c | |
| parent | b00809a32285be24a0ad41ecd1f906e719742c86 (diff) | |
| download | php-git-f47962c7c09bb9c9bb7a7acc767b45dbd1b6489d.tar.gz | |
Implement import_request_variables()
Diffstat (limited to 'main/main.c')
| -rw-r--r-- | main/main.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/main/main.c b/main/main.c index 7b3252ce7e..620ba9bc58 100644 --- a/main/main.c +++ b/main/main.c @@ -105,6 +105,7 @@ static int short_track_vars_names_length[] = { sizeof("_FILES") }; +#define NUM_TRACK_VARS (sizeof(short_track_vars_names_length)/sizeof(int)) #define SAFE_FILENAME(f) ((f)?(f):"-") @@ -718,6 +719,15 @@ void php_request_shutdown(void *dummy) if (PG(modules_activated)) { zend_deactivate_modules(TSRMLS_C); } + + zend_try { + int i; + + for (i=0; i<NUM_TRACK_VARS; i++) { + zval_ptr_dtor(&PG(http_globals)[i]); + } + } zend_end_try(); + zend_deactivate(TSRMLS_C); @@ -891,7 +901,7 @@ int php_module_startup(sapi_module_struct *sf) } zuv.import_use_extension = ".php"; - for (i=0; i<6; i++) { + for (i=0; i<NUM_TRACK_VARS; i++) { zend_register_auto_global(short_track_vars_names[i], short_track_vars_names_length[i]-1 TSRMLS_CC); } zend_register_auto_global("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC); @@ -1057,7 +1067,7 @@ static int php_hash_environment(TSRMLS_D) }; - for (i=0; i<6; i++) { + for (i=0; i<NUM_TRACK_VARS; i++) { PG(http_globals)[i] = NULL; } @@ -1118,7 +1128,7 @@ static int php_hash_environment(TSRMLS_D) php_register_server_variables(TSRMLS_C); } - for (i=0; i<6; i++) { + for (i=0; i<NUM_TRACK_VARS; i++) { if (!PG(http_globals)[i]) { if (!initialized_dummy_track_vars_array) { ALLOC_ZVAL(dummy_track_vars_array); @@ -1133,6 +1143,7 @@ static int php_hash_environment(TSRMLS_D) zend_hash_update(&EG(symbol_table), track_vars_names[i], track_vars_names_length[i], &PG(http_globals)[i], sizeof(zval *), NULL); PG(http_globals)[i]->refcount++; zend_hash_update(&EG(symbol_table), short_track_vars_names[i], short_track_vars_names_length[i], &PG(http_globals)[i], sizeof(zval *), NULL); + PG(http_globals)[i]->refcount++; } { |
