Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15099 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75327 invoked by uid 1010); 18 Feb 2005 18:18:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75307 invoked from network); 18 Feb 2005 18:18:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2005 18:18:33 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:46186] helo=mail.zend.com) by pb1.pair.com (ecelerity 1.2 (r4437)) with SMTP id 2A/31-40085-26136124 for ; Fri, 18 Feb 2005 13:18:10 -0500 Received: (qmail 27426 invoked from network); 18 Feb 2005 18:18:06 -0000 Received: from localhost (HELO DORON-LAPTOP.zend.com) (127.0.0.1) by localhost with SMTP; 18 Feb 2005 18:18:06 -0000 Message-ID: <5.1.0.14.2.20050217101706.01f6dda0@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 17 Feb 2005 10:18:21 -0800 To: ,internals@lists.php.net In-Reply-To: <00c001c515d4$840fdf90$0201a8c0@gabriel> References: <005801c5156b$ae0711b0$0201a8c0@gabriel> <855185390.20050218092558@marcus-boerger.de> <008701c515a7$4fec38d0$0201a8c0@gabriel> <20050218121817.30870.qmail@lists.php.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] function proposal - php_check_syntax_string From: andi@zend.com (Andi Gutmans) I personally can't think of a good way to achieve this because some of the= =20 engine internals can be left in an unstable state after a fatal error. I suggest to either use parsekit or an external PHP (either CLI or make one= =20 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" >To: >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" >| > To: "Fr=C3=A9d=C3=A9ric LECOINTRE" >| > Cc: >| > Sent: Friday, February 18, 2005 9:25 AM >| > Subject: Re: [PHP-DEV] function proposal - php_check_syntax_string >| > >| > >| > | Hello Fr=C3=A9d=C3=A9ric, >| > | >| > | 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:helly@php.net >| > | >| >| -- >| Johannes Schl=C3=BCter 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