dmitry Fri Apr 7 13:45:23 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/sapi/cgi cgi_main.c Log: 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 http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.12&r2=1.267.2.13&diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.12 php-src/sapi/cgi/cgi_main.c:1.267.2.13 --- php-src/sapi/cgi/cgi_main.c:1.267.2.12 Fri Apr 7 12:39:43 2006 +++ php-src/sapi/cgi/cgi_main.c Fri Apr 7 13:45:23 2006 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.267.2.12 2006/04/07 12:39:43 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.13 2006/04/07 13:45:23 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -431,6 +431,17 @@ #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;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php