summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorHartmut Holzgraefe <hholzgra@php.net>2000-07-28 15:21:20 +0000
committerHartmut Holzgraefe <hholzgra@php.net>2000-07-28 15:21:20 +0000
commit1a7f851985e5ee6cdd6f76b67d6caa9616c8b6f8 (patch)
treede7249a7adaf2f2ae5a804014dc73f50c35dd9ba /main/main.c
parenta525d022cebedb5d8c10c5d2b698117824b0a90c (diff)
downloadphp-git-1a7f851985e5ee6cdd6f76b67d6caa9616c8b6f8.tar.gz
added '-l' option to command line / CGI version for 'syntax check only'
plus a little cleanup and rearranging in command line option parsing @ CGI aka. command line version has now an option '-l' for syntax check @ without execution (Hartmut)
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/main/main.c b/main/main.c
index f72083bea8..27787c6cd3 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1170,6 +1170,28 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_
}
}
+PHPAPI int php_lint_script(zend_file_handle *file CLS_DC ELS_DC PLS_DC)
+{
+ SLS_FETCH();
+
+ php_hash_environment(ELS_C SLS_CC PLS_CC);
+
+ zend_activate_modules();
+ PG(modules_activated)=1;
+
+ if (setjmp(EG(bailout))!=0) {
+ return FAILURE;
+ }
+
+#ifdef PHP_WIN32
+ UpdateIniFromRegistry(primary_file->filename);
+#endif
+
+ EG(main_op_array) = zend_compile_files(ZEND_REQUIRE CLS_CC, 1, file);
+
+ return (EG(main_op_array)) ? SUCCESS : FAILURE;
+}
+
#ifdef PHP_WIN32
/* just so that this symbol gets exported... */
PHPAPI void dummy_indent()