]> granicus.if.org Git - php/commitdiff
MFH: Removed php_check_syntax() function, it never worked properly. For now
authorIlia Alshanetsky <iliaa@php.net>
Wed, 6 Apr 2005 14:21:03 +0000 (14:21 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 6 Apr 2005 14:21:03 +0000 (14:21 +0000)
use shell_exec("php -l script_name") or similar.

NEWS
ext/standard/basic_functions.c
ext/standard/basic_functions.h

diff --git a/NEWS b/NEWS
index 0d1102fa3dc7eb70fcecb86b3386a8b269c149df..a57e8eeab1b0979a7ed4380f8bf539c4094d1433 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2005, PHP 5.0.5
+- Removed php_check_syntax() function, never worked properly. (Ilia)
 - Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets).
   (Ilia)
 - Fixed bug #32560 (configure looks for incorrect db2 library). (Tony)
index d7fdfc145002081ebf5db022e4787f5d083caf74..071e3415e0db833c9c2ff110241b3b0bc408528e 100644 (file)
@@ -469,7 +469,6 @@ function_entry basic_functions[] = {
        PHP_FALIAS(show_source,                 highlight_file,                                                 NULL)
        PHP_FE(highlight_string,                                                                                                NULL)
        PHP_FE(php_strip_whitespace,                                                                                            NULL)
-       PHP_FE(php_check_syntax,                                                                                                second_arg_force_ref)
 
        PHP_FE(ini_get,                                                                                                                 NULL)
        PHP_FE(ini_get_all,                                                                                                             NULL)
@@ -2323,49 +2322,6 @@ PHP_FUNCTION(php_strip_whitespace)
 }
 /* }}} */
 
-/* {{{ proto bool php_check_syntax(string file_name [, &$error_message])
-   Check the syntax of the specified file. */
-PHP_FUNCTION(php_check_syntax)
-{
-       char *filename;
-       int filename_len;
-       zval *errm=NULL;
-       zend_file_handle file_handle = {0};
-
-       int old_errors = PG(display_errors);
-       int log_errors = PG(log_errors);
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &filename, &filename_len, &errm) == FAILURE) {
-               RETURN_FALSE;
-       }
-
-       file_handle.type = ZEND_HANDLE_FILENAME;
-       file_handle.filename = filename;
-       file_handle.free_filename = 0;
-       file_handle.opened_path = NULL; 
-
-       PG(log_errors) = PG(display_errors) = 0;
-
-       if (php_lint_script(&file_handle TSRMLS_CC) != SUCCESS) {
-               if (errm) {
-                       char *error_str;
-
-                       zval_dtor(errm);
-                       spprintf(&error_str, 0, "%s in %s on line %d", PG(last_error_message), PG(last_error_file), PG(last_error_lineno));
-                       ZVAL_STRING(errm, error_str, 0);
-               }
-               RETVAL_FALSE;
-       } else {
-               RETVAL_TRUE;
-       }
-
-       PG(display_errors) = old_errors;
-       PG(log_errors) = log_errors;
-
-       return;
-}
-/* }}} */
-
 /* {{{ proto bool highlight_string(string string [, bool return] )
    Syntax highlight a string or optionally return it */
 PHP_FUNCTION(highlight_string)
index 468d27c4449f9756406025f7ac54fcc7f1641a1d..83e704abf3d98d197c30814dfd528d7b10e6e759 100644 (file)
@@ -82,7 +82,6 @@ PHP_FUNCTION(register_shutdown_function);
 PHP_FUNCTION(highlight_file);
 PHP_FUNCTION(highlight_string);
 PHP_FUNCTION(php_strip_whitespace);
-PHP_FUNCTION(php_check_syntax);
 ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini);
 
 PHP_FUNCTION(ini_get);