mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
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.
This commit is contained in:
parent
1e5869c660
commit
2a44432e8c
@ -1013,37 +1013,31 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!cgi
|
while ((c=php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) {
|
||||||
#if PHP_FASTCGI
|
switch (c) {
|
||||||
/* allow ini override for fastcgi */
|
case 'c':
|
||||||
#endif
|
cgi_sapi_module.php_ini_path_override = strdup(php_optarg);
|
||||||
) {
|
break;
|
||||||
while ((c=php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) {
|
case 'n':
|
||||||
switch (c) {
|
cgi_sapi_module.php_ini_ignore = 1;
|
||||||
case 'c':
|
break;
|
||||||
cgi_sapi_module.php_ini_path_override = strdup(php_optarg);
|
|
||||||
break;
|
|
||||||
case 'n':
|
|
||||||
cgi_sapi_module.php_ini_ignore = 1;
|
|
||||||
break;
|
|
||||||
#if PHP_FASTCGI
|
#if PHP_FASTCGI
|
||||||
#ifndef PHP_WIN32
|
#ifndef PHP_WIN32
|
||||||
/* if we're started on command line, check to see if
|
/* if we're started on command line, check to see if
|
||||||
we are being started as an 'external' fastcgi
|
we are being started as an 'external' fastcgi
|
||||||
server by accepting a bindpath parameter. */
|
server by accepting a bindpath parameter. */
|
||||||
case 'b':
|
case 'b':
|
||||||
if (!fastcgi) {
|
if (!fastcgi) {
|
||||||
bindpath = strdup(php_optarg);
|
bindpath = strdup(php_optarg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
php_optind = orig_optind;
|
|
||||||
php_optarg = orig_optarg;
|
|
||||||
}
|
}
|
||||||
|
php_optind = orig_optind;
|
||||||
|
php_optarg = orig_optarg;
|
||||||
|
|
||||||
#ifdef ZTS
|
#ifdef ZTS
|
||||||
compiler_globals = ts_resource(compiler_globals_id);
|
compiler_globals = ts_resource(compiler_globals_id);
|
||||||
@ -1249,28 +1243,22 @@ consult the installation file that came with this distribution, or visit \n\
|
|||||||
#endif /* FASTCGI */
|
#endif /* FASTCGI */
|
||||||
|
|
||||||
zend_first_try {
|
zend_first_try {
|
||||||
if (!cgi
|
while ((c=php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1))!=-1) {
|
||||||
#if PHP_FASTCGI
|
switch (c) {
|
||||||
&& !fastcgi
|
case 'h':
|
||||||
#endif
|
case '?':
|
||||||
) {
|
no_headers = 1;
|
||||||
while ((c=php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1))!=-1) {
|
php_output_startup();
|
||||||
switch (c) {
|
php_output_activate(TSRMLS_C);
|
||||||
case 'h':
|
SG(headers_sent) = 1;
|
||||||
case '?':
|
php_cgi_usage(argv[0]);
|
||||||
no_headers = 1;
|
php_end_ob_buffers(1 TSRMLS_CC);
|
||||||
php_output_startup();
|
exit(1);
|
||||||
php_output_activate(TSRMLS_C);
|
break;
|
||||||
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
|
#if PHP_FASTCGI
|
||||||
/* start of FAST CGI loop */
|
/* start of FAST CGI loop */
|
||||||
|
Loading…
Reference in New Issue
Block a user