diff options
| author | Zeev Suraski <zeev@php.net> | 2000-11-07 18:25:29 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2000-11-07 18:25:29 +0000 |
| commit | 9e40204f0004a84f45621f1790c29dc52f2784d2 (patch) | |
| tree | 50a7f719f7a9ae9300cebba6d7cb71f9ac5431c8 /main | |
| parent | 50e0d9d34b9b9669d0fa2682d060ff60ffc7a9e6 (diff) | |
| download | php-git-9e40204f0004a84f45621f1790c29dc52f2784d2.tar.gz | |
@- In CGI mode, $HTTP_SERVER_VARS now includes all of the environment variables
@ as well (Zeev)
Diffstat (limited to 'main')
| -rw-r--r-- | main/main.c | 10 | ||||
| -rw-r--r-- | main/php_variables.c | 8 | ||||
| -rw-r--r-- | main/php_variables.h | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/main/main.c b/main/main.c index 3a8af10da3..2ef64e9af1 100644 --- a/main/main.c +++ b/main/main.c @@ -1015,7 +1015,10 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC) } else { p = PG(gpc_order); have_variables_order=0; - php_import_environment_variables(ELS_C PLS_CC); + ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]); + array_init(PG(http_globals)[TRACK_VARS_ENV]); + INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]); + php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] ELS_CC PLS_CC); } while(p && *p) { @@ -1044,7 +1047,10 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC) case 'e': case 'E': if (have_variables_order) { - php_import_environment_variables(ELS_C PLS_CC); + ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]); + array_init(PG(http_globals)[TRACK_VARS_ENV]); + INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]); + php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] ELS_CC PLS_CC); } else { php_error(E_WARNING, "Unsupported 'e' element (environment) used in gpc_order - use variables_order instead"); } diff --git a/main/php_variables.c b/main/php_variables.c index bff78e4a79..08a201e874 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -301,15 +301,9 @@ void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC) -void php_import_environment_variables(ELS_D PLS_DC) +void php_import_environment_variables(zval *array_ptr ELS_DC PLS_DC) { char **env, *p, *t; - zval *array_ptr=NULL; - - ALLOC_ZVAL(array_ptr); - array_init(array_ptr); - INIT_PZVAL(array_ptr); - PG(http_globals)[TRACK_VARS_ENV] = array_ptr; for (env = environ; env != NULL && *env != NULL; env++) { p = strchr(*env, '='); diff --git a/main/php_variables.h b/main/php_variables.h index f71fe2762b..bd0a98810a 100644 --- a/main/php_variables.h +++ b/main/php_variables.h @@ -31,7 +31,7 @@ #define PARSE_STRING 3 void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC); -void php_import_environment_variables(ELS_D PLS_DC); +PHPAPI void php_import_environment_variables(zval *array_ptr ELS_DC PLS_DC); PHPAPI void php_register_variable(char *var, char *val, pval *track_vars_array ELS_DC PLS_DC); PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_array ELS_DC PLS_DC); |
