]> granicus.if.org Git - php/commitdiff
- Fixed bug #55533 (The -d parameter doesn't work)
authorJérôme Loyet <fat@php.net>
Sun, 9 Oct 2011 14:36:11 +0000 (14:36 +0000)
committerJérôme Loyet <fat@php.net>
Sun, 9 Oct 2011 14:36:11 +0000 (14:36 +0000)
sapi/fpm/fpm/fpm_main.c

index 752a8c85d440a235ba1fb396c485d05be8a7b448..a9298e757352ad3429166048da1a45088fb130e0 100644 (file)
@@ -1521,6 +1521,7 @@ int main(int argc, char *argv[])
        char *fpm_prefix = NULL;
        char *fpm_pid = NULL;
        int test_conf = 0;
+       int php_information = 0;
 
 #ifdef HAVE_SIGNAL_H
 #if defined(SIGPIPE) && defined(SIG_IGN)
@@ -1632,20 +1633,8 @@ int main(int argc, char *argv[])
                                goto out;
 
                        case 'i': /* php info & quit */
-                               cgi_sapi_module.phpinfo_as_text = 1;
-                               cgi_sapi_module.startup(&cgi_sapi_module);
-                               if (php_request_startup(TSRMLS_C) == FAILURE) {
-                                       SG(server_context) = NULL;
-                                       php_module_shutdown(TSRMLS_C);
-                                       return FAILURE;
-                               }
-                               SG(headers_sent) = 1;
-                               SG(request_info).no_headers = 1;
-                               php_print_info(0xFFFFFFFF TSRMLS_CC);
-                               php_request_shutdown((void *) 0);
-                               fcgi_shutdown();
-                               exit_status = 0;
-                               goto out;
+                               php_information = 1;
+                               break;
 
                        default:
                        case 'h':
@@ -1682,6 +1671,23 @@ int main(int argc, char *argv[])
                }
        }
 
+       if (php_information) {
+               cgi_sapi_module.phpinfo_as_text = 1;
+               cgi_sapi_module.startup(&cgi_sapi_module);
+               if (php_request_startup(TSRMLS_C) == FAILURE) {
+                       SG(server_context) = NULL;
+                       php_module_shutdown(TSRMLS_C);
+                       return FAILURE;
+               }
+               SG(headers_sent) = 1;
+               SG(request_info).no_headers = 1;
+               php_print_info(0xFFFFFFFF TSRMLS_CC);
+               php_request_shutdown((void *) 0);
+               fcgi_shutdown();
+               exit_status = 0;
+               goto out;
+       }
+
        /* No other args are permitted here as there is no interactive mode */
        if (argc != php_optind) {
                cgi_sapi_module.startup(&cgi_sapi_module);