cvs commit
| From: | zeev | Date: | Sat, 03 Jul 1999 19:15:11 +0000 |
| Subject: | cvs commit | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1875@lists.php.net to get a copy of this message | ||
From: zeev
Date: Sat Jul 3 19:15:11 1999
Modified files:
php4/main.c
Log message:
Support x-httpd-php-source
Index: php4/main.c
diff -u php4/main.c:1.78 php4/main.c:1.79
--- php4/main.c:1.78 Sat Jun 26 08:27:49 1999
+++ php4/main.c Sat Jul 3 19:15:10 1999
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.78 1999/06/26 12:27:49 zeev Exp $ */
+/* $Id: main.c,v 1.79 1999/07/03 23:15:10 zeev Exp $ */
#include <stdio.h>
@@ -103,10 +103,6 @@
void *gLock; /*mutex variable */
-#define PHP_MODE_STANDARD 1
-#define PHP_MODE_HIGHLIGHT 2
-#define PHP_MODE_INDENT 3
-
/* True globals (no need for thread safety) */
HashTable configuration_hash;
PHPAPI char *php3_ini_path = NULL;
@@ -1166,7 +1162,21 @@
file_handle.type = ZEND_HANDLE_FD;
file_handle.handle.fd = fd;
file_handle.filename = SG(request_info).path_translated;
- (void) php_execute_script(&file_handle CLS_CC ELS_CC);
+
+ if (display_source_mode) {
+ zend_syntax_highlighter_ini syntax_highlighter_ini;
+
+ if (open_file_for_scanning(&file_handle CLS_CC)==SUCCESS) {
+ php_get_highlight_struct(&syntax_highlighter_ini);
+ zend_highlight(&syntax_highlighter_ini);
+ fclose(file_handle.handle.fp);
+ return OK;
+ } else {
+ return NOT_FOUND;
+ }
+ } else {
+ (void) php_execute_script(&file_handle CLS_CC ELS_CC);
+ }
php3_header(); /* Make sure headers have been sent */
zend_end_ob_buffering(1);