Why is this needed?
Looks pretty ugly to me to check specifically for run-tests.php.

Andi

At 04:37 PM 11/12/2002 +0000, Hartmut Holzgraefe wrote:
hholzgra Tue Nov 12 11:37:47 2002 EDT

Modified files:
/php4/sapi/cgi cgi_main.c
Log:



Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.187 php4/sapi/cgi/cgi_main.c:1.188
--- php4/sapi/cgi/cgi_main.c:1.187 Tue Nov 5 17:04:10 2002
+++ php4/sapi/cgi/cgi_main.c Tue Nov 12 11:37:47 2002
@@ -522,7 +522,7 @@
int main(int argc, char *argv[])
{
int exit_status = SUCCESS;
- int cgi = 0, c, i, len;
+ int cgi = 0, c, i, len, testmode = 0;
zend_file_handle file_handle;
int retval = FAILURE;
char *s;
@@ -573,6 +573,10 @@
#endif
#endif

+#ifndef PHP_FASTCGI
+ s = getenv("USER_AGENT");
+ if(s && !strcmp(s, "run-tests.php")) testmode = 1;
+#endif

#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
@@ -875,11 +879,11 @@

zend_llist_init(&global_vars, sizeof(char *), NULL, 0);

- if (!cgi
+ if ( testmode || (!cgi
#ifdef PHP_FASTCGI
&& !fastcgi
#endif
- ) { /* never execute the arguments if you are a CGI */
+ )) { /* never execute the arguments if you are a CGI unless in testmode*/
if (SG(request_info).argv0) {
free(SG(request_info).argv0);
SG(request_info).argv0 = NULL;



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

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

Reply via email to