diff options
author | Hartmut Holzgraefe <hholzgra@php.net> | 2002-11-12 16:37:47 +0000 |
---|---|---|
committer | Hartmut Holzgraefe <hholzgra@php.net> | 2002-11-12 16:37:47 +0000 |
commit | 0c395d0f4cf9275a11f3c71156fe0a3a1d329d36 (patch) | |
tree | cbf6e5ef6e47c446b99647aea770b692ce663b3a /sapi | |
parent | 619fc2c3c0a3d91e0c8853e0b5471744b97c6e5b (diff) | |
download | php-git-0c395d0f4cf9275a11f3c71156fe0a3a1d329d36.tar.gz |
*** empty log message ***
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/cgi/cgi_main.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 2d707d7e43..89e94029e0 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -522,7 +522,7 @@ static void php_register_command_line_global_vars(char **arg TSRMLS_DC) 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 @@ int main(int argc, char *argv[]) #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 @@ consult the installation file that came with this distribution, or visit \n\ 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; |