I suggest to either use parsekit or an external PHP (either CLI or make one more http request and parse the output).
Andi
At 05:11 PM 2/18/2005 +0100, wrote:
oups ... well.
php_check_syntax works fine with zend_compile_file. so what's the difference? i read parse_kit extension and after compiling, attempt to remove class and function with "php_parsekit_common".
Is there possibilty to run syntax check only with compil_string in zend_language_scanner.c (or something else) instead of removing the introduced code?
fred ----- Original Message ----- From: "Johannes Schlueter" <[EMAIL PROTECTED]> To: <internals@lists.php.net> Sent: Friday, February 18, 2005 1:17 PM Subject: Re: [PHP-DEV] function proposal - php_check_syntax_string
| Hi Fred, | | this patch doesn't just check wether the string has the right syntax but | also compiles it and registers it's functions and classes in the relevant | tables. | | $ sapi/cli/php -r "php_check_syntax_string('class foo {}'); | var_dump(class_exists('foo'));" | bool(true) | | johannes | | Unknown Sender wrote: | | > Hello Marcus, | > | > Based on 5.0.3 source distribution, inspired of parsekit_compile_string | > | > fred | > ----- Original Message ----- | > From: "Marcus Boerger" <[EMAIL PROTECTED]> | > To: "Frédéric LECOINTRE" <[EMAIL PROTECTED]> | > Cc: <internals@lists.php.net> | > Sent: Friday, February 18, 2005 9:25 AM | > Subject: Re: [PHP-DEV] function proposal - php_check_syntax_string | > | > | > | Hello Frédéric, | > | | > | do you have some c code you can post here as a .txt attachment or as a | > link? | > | | > | regards | > | marcus | > | | > | Friday, February 18, 2005, 4:41:06 AM, you wrote: | > | | > | > hi all, | > | | > | > to check syntax of pieces of code and to avoid wild regular | > | > expressions, | > i | > | > wrote this: | > | | > | > proto bool php_check_syntax_string(string string [, &$error_message]) | > | | > | > like php_check_syntax but on string | > | > it will be useful for applications who have to store valid code like | > smarty, | > | > ... | > | > is it possible to add it? | > | | > | > regards | > | | > | > fred | > | | > | | > | | > | | > | -- | > | Best regards, | > | Marcus mailto:[EMAIL PROTECTED] | > | | | -- | Johannes Schlüter Mayflower GmbH / ThinkPHP | http://thinkphp.de http://blog.thinkphp.de | | -- | PHP Internals - PHP Runtime Development Mailing List | To unsubscribe, visit: http://www.php.net/unsub.php |
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php