cvs: php4 /sapi/cgi cgi_main.c
| From: | Hartmut Holzgraefe | Date: | Tue, 12 Nov 2002 16:37:47 +0000 |
| Subject: | cvs: php4 /sapi/cgi cgi_main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-16035@lists.php.net to get a copy of this message | ||
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;