Skip to content

Commit

Permalink
CGI anf FastCGI assume $_SERVER and $_ENV have the same values,
Browse files Browse the repository at this point in the history
so we don't need construct the same arrays twich and may just copy it
  • Loading branch information
dstogov committed Apr 7, 2006
1 parent 670ed5d commit 79b3d79
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sapi/cgi/cgi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,17 @@ static char *sapi_cgi_read_cookies(TSRMLS_D)
#if PHP_FASTCGI
void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
{
if (PG(http_globals)[TRACK_VARS_ENV] &&
array_ptr != PG(http_globals)[TRACK_VARS_ENV]) {
*array_ptr = *PG(http_globals)[TRACK_VARS_ENV];
zval_copy_ctor(array_ptr);
return;
} else if (PG(http_globals)[TRACK_VARS_SERVER] &&
array_ptr != PG(http_globals)[TRACK_VARS_SERVER]) {
*array_ptr = *PG(http_globals)[TRACK_VARS_SERVER];
zval_copy_ctor(array_ptr);
return;
}
if (!FCGX_IsCGI()) {
FCGX_Request *request = (FCGX_Request *) SG(server_context);
char **env, *p;
Expand Down

0 comments on commit 79b3d79

Please sign in to comment.