I have tested for this problem on HEAD, but I can't seem to make it happen.  
Some how the auto global code kicks in and they get registered.  I haven't 
been able to figure out why that is since "_SERVER" seems to be how $_SERVER 
is registered and argv and argc names are not registered. I had planed on 
porting the patch to HEAD, but it may not be needed with auto globals.  

Even if the code is not needed (because of auto globals), patch the code any 
way so the code bases look the same (php_build_argv param change and moving 
things around).  If that is the case I will commit the changes to branch HEAD. 
 Let me know.

Thanks,

Brian

On Tue, 1 Apr 2003 02:45:23 +0300 (EEST), Jani Taskinen wrote:
> 
>     Would be nice if this was fixed in HEAD too.
> 
>     --Jani
> 
> On Mon, 31 Mar 2003, Brian France wrote:
> 
>> bfrance              Mon Mar 31 16:24:59 2003 EDT
>> 
>>   Modified files:              (Branch: PHP_4_3)
>>     /php4/main       main.c 
>>   Log:
>>   
>>      Fixes the problem where argv and argc are not populated unless S 
>>      is in the variables_order, even if register_argc_argv is on.
>>   
>>   
>>   
>> Index: php4/main/main.c
>> diff -u php4/main/main.c:1.512.2.20 php4/main/main.c:1.512.2.21
>> --- php4/main/main.c:1.512.2.20      Wed Mar 19 03:22:35 2003
>> +++ php4/main/main.c Mon Mar 31 16:24:59 2003
>> @@ -18,7 +18,7 @@
>>     +----------------------------------------------------------------------+
>>  */
>>  
>> -/* $Id: main.c,v 1.512.2.20 2003/03/19 08:22:35 sniper Exp $ */
>> +/* $Id: main.c,v 1.512.2.21 2003/03/31 21:24:59 bfrance Exp $ */
>>  
>>  /* {{{ includes
>>   */
>> @@ -110,7 +110,7 @@
>>  
>>  static last_error_type last_error;
>>  
>> -static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC);
>> +static void php_build_argv(char *s TSRMLS_DC);
>>  
>>  
>>  static char *short_track_vars_names[] = {
>> @@ -1317,11 +1317,6 @@
>>              sapi_module.register_server_variables(array_ptr TSRMLS_CC);
>>      }
>>  
>> -    /* argv/argc support */
>> -    if (PG(register_argc_argv)) {
>> -            php_build_argv(SG(request_info).query_string, array_ptr TSRMLS_CC);
>> -    }
>> -
>>      /* PHP Authentication support */
>>      if (SG(request_info).auth_user) {
>>              php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, 
array_ptr TSRMLS_CC);
>> @@ -1423,6 +1418,11 @@
>>              php_register_server_variables(TSRMLS_C);
>>      }
>>  
>> +    /* argv/argc support */
>> +    if (PG(register_argc_argv)) {
>> +            php_build_argv(SG(request_info).query_string TSRMLS_CC);
>> +    }
>> +
>>      for (i=0; i<NUM_TRACK_VARS; i++) {
>>              if (!PG(http_globals)[i]) {
>>                      if (!initialized_dummy_track_vars_array) {
>> @@ -1474,7 +1474,7 @@
>>  
>>  /* {{{ php_build_argv
>>   */
>> -static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
>> +static void php_build_argv(char *s TSRMLS_DC)
>>  {
>>      pval *arr, *argc, *tmp;
>>      int count = 0;
>> @@ -1544,8 +1544,10 @@
>>              zend_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &argc, 
sizeof(zval *), NULL);
>>      }
>>  
>> -    zend_hash_update(Z_ARRVAL_P(track_vars_array), "argv", sizeof("argv"), 
&arr, sizeof(pval *), NULL);
>> -    zend_hash_update(Z_ARRVAL_P(track_vars_array), "argc", sizeof("argc"), 
&argc, sizeof(pval *), NULL);
>> +    if ( PG(http_globals)[TRACK_VARS_SERVER] != NULL ) {
>> +            zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), 
"argv", sizeof("argv"), &arr, sizeof(pval *), NULL);
>> +            zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), 
"argc", sizeof("argc"), &argc, sizeof(pval *), NULL);
>> +    }
>>  }
>>  /* }}} */
>>  
>> 
>> 
>> 
>> 
> 
> -- 
> <- For Sale! ->
> 
> 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to