rasmus Fri Feb 27 18:31:29 2004 EDT Modified files: /php-src/sapi/cgi cgi_main.c Log: As discussed a while ago. There is no reason to disallow command-line arguments for the cgi version when run in a cgi context. Our own test framework is in fact broken because of this unnecessary restriction. http://cvs.php.net/diff.php/php-src/sapi/cgi/cgi_main.c?r1=1.249&r2=1.250&ty=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.249 php-src/sapi/cgi/cgi_main.c:1.250 --- php-src/sapi/cgi/cgi_main.c:1.249 Wed Feb 11 16:00:44 2004 +++ php-src/sapi/cgi/cgi_main.c Fri Feb 27 18:31:28 2004 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.249 2004/02/11 21:00:44 helly Exp $ */ +/* $Id: cgi_main.c,v 1.250 2004/02/27 23:31:28 rasmus Exp $ */ #include "php.h" #include "php_globals.h" @@ -1013,37 +1013,31 @@ } #endif - if (!cgi -#if PHP_FASTCGI - /* allow ini override for fastcgi */ -#endif - ) { - while ((c=php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) { - switch (c) { - case 'c': - cgi_sapi_module.php_ini_path_override = strdup(php_optarg); - break; - case 'n': - cgi_sapi_module.php_ini_ignore = 1; - break; + while ((c=php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) { + switch (c) { + case 'c': + cgi_sapi_module.php_ini_path_override = strdup(php_optarg); + break; + case 'n': + cgi_sapi_module.php_ini_ignore = 1; + break; #if PHP_FASTCGI #ifndef PHP_WIN32 - /* if we're started on command line, check to see if - we are being started as an 'external' fastcgi - server by accepting a bindpath parameter. */ - case 'b': - if (!fastcgi) { - bindpath = strdup(php_optarg); - } - break; + /* if we're started on command line, check to see if + we are being started as an 'external' fastcgi + server by accepting a bindpath parameter. */ + case 'b': + if (!fastcgi) { + bindpath = strdup(php_optarg); + } + break; #endif #endif - } - } - php_optind = orig_optind; - php_optarg = orig_optarg; + } + php_optind = orig_optind; + php_optarg = orig_optarg; #ifdef ZTS compiler_globals = ts_resource(compiler_globals_id); @@ -1249,28 +1243,22 @@ #endif /* FASTCGI */ zend_first_try { - if (!cgi -#if PHP_FASTCGI - && !fastcgi -#endif - ) { - while ((c=php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1))!=-1) { - switch (c) { - case 'h': - case '?': - no_headers = 1; - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_cgi_usage(argv[0]); - php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - break; - } + while ((c=php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1))!=-1) { + switch (c) { + case 'h': + case '?': + no_headers = 1; + php_output_startup(); + php_output_activate(TSRMLS_C); + SG(headers_sent) = 1; + php_cgi_usage(argv[0]); + php_end_ob_buffers(1 TSRMLS_CC); + exit(1); + break; } - php_optind = orig_optind; - php_optarg = orig_optarg; } + php_optind = orig_optind; + php_optarg = orig_optarg; #if PHP_FASTCGI /* start of FAST CGI loop */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php