]> granicus.if.org Git - php/commitdiff
make -c in stand-alone mode work again.
authorStanislav Malyshev <stas@php.net>
Thu, 13 Jul 2000 09:17:39 +0000 (09:17 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 13 Jul 2000 09:17:39 +0000 (09:17 +0000)
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

sapi/cgi/cgi_main.c

index 9cbcb2c9a6fa46d7de749fa69b44fa36323bf216..a582393c98f32933e18b7a7c9ef652625ad8c65f 100644 (file)
@@ -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();