From: Stanislav Malyshev Date: Thu, 13 Jul 2000 09:17:39 +0000 (+0000) Subject: make -c in stand-alone mode work again. X-Git-Tag: PRE_FILE_COMPILE_API_CHANGE~289 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c6ffdb1c248e106559f418a2cf130e76c53c861;p=php make -c in stand-alone mode work again. Setting ini_path after php_module_startup doesn't do much good - since php_module_startup reads .ini. # This fix is very ugly. Everyone is welcome to make better fix # that won't report errors twice and won't scan argument 3 times --- diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 9cbcb2c9a6..a582393c98 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -447,6 +447,19 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine #endif /* FORCE_CGI_REDIRECT */ } + if (!cgi) { + while ((c=ap_php_getopt(argc, argv, "c:d:z:g:qvisnaeh?vf:"))!=-1) { + switch (c) { + case 'c': + php_ini_path = strdup(ap_php_optarg); /* intentional leak */ + break; + } + + } + ap_php_optind = orig_optind; + ap_php_optarg = orig_optarg; + } + if (php_module_startup(&sapi_module)==FAILURE) { return FAILURE; } @@ -463,9 +476,6 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine if (!cgi) { while ((c=ap_php_getopt(argc, argv, "c:d:z:g:qvisnaeh?vf:"))!=-1) { switch (c) { - case 'c': - php_ini_path = strdup(ap_php_optarg); /* intentional leak */ - break; case '?': no_headers = 1; php_output_startup();