dmitry          Fri Apr  7 13:45:51 2006 UTC

  Modified files:              
    /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.283&r2=1.284&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.283 php-src/sapi/cgi/cgi_main.c:1.284
--- php-src/sapi/cgi/cgi_main.c:1.283   Fri Apr  7 12:39:28 2006
+++ php-src/sapi/cgi/cgi_main.c Fri Apr  7 13:45:51 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: cgi_main.c,v 1.283 2006/04/07 12:39:28 dmitry Exp $ */
+/* $Id: cgi_main.c,v 1.284 2006/04/07 13:45:51 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -410,6 +410,17 @@
 
 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

Reply via email to