mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
CGI anf FastCGI assume $_SERVER and $_ENV have the same values,
so we don't need construct the same arrays twich and may just copy it
This commit is contained in:
parent
a29f09dcc5
commit
f3c00034b6
@ -410,6 +410,17 @@ static char *sapi_cgi_read_cookies(TSRMLS_D)
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user