]> granicus.if.org Git - php/commitdiff
MFB: Allow using syntax highlighting in fastcgi mode
authorfoobar <sniper@php.net>
Sun, 15 Apr 2007 23:02:05 +0000 (23:02 +0000)
committerfoobar <sniper@php.net>
Sun, 15 Apr 2007 23:02:05 +0000 (23:02 +0000)
sapi/cgi/cgi_main.c

index 32d293cf8fa666f15f5f0c8eba19cc4e3ffdafda..02a0e5d5849f0296e7026b874d4d91cd0e4e3ccc 100644 (file)
@@ -1172,8 +1172,10 @@ int main(int argc, char *argv[])
                                        bindpath = strdup(php_optarg);
                                }
                                break;
+                       case 's': /* generate highlighted HTML from source */
+                               behavior = PHP_MODE_HIGHLIGHT;
+                               break;
                }
-
        }
        php_optind = orig_optind;
        php_optarg = orig_optarg;
@@ -1456,10 +1458,6 @@ consult the installation file that came with this distribution, or visit \n\
                                                        no_headers = 1;
                                                        break;
 
-                                       case 's': /* generate highlighted HTML from source */
-                                                       behavior = PHP_MODE_HIGHLIGHT;
-                                                       break;
-
                                                case 'v': /* show php version & quit */
                                                        no_headers = 1;
                                                        if (php_request_startup(TSRMLS_C) == FAILURE) {
@@ -1660,6 +1658,9 @@ consult the installation file that came with this distribution, or visit \n\
                                                if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) {
                                                        php_get_highlight_struct(&syntax_highlighter_ini);
                                                        zend_highlight(&syntax_highlighter_ini TSRMLS_CC);
+                                                       if (fastcgi) {
+                                                               goto fastcgi_request_done;
+                                                       }
                                                        fclose(file_handle.handle.fp);
                                                        php_output_teardown();
                                                }