Re: [PHP-DEV] validate_file() and strip_file()

2003-11-20 Thread Ilia Alshanetsky
On November 20, 2003 02:22 am, Andi Gutmans wrote:> > Andi > > P.S.-If you think php_strip_whitespace() is misleading then see if you can > find a better name. I think php_strip() is just too short and will be > confused with strip() (which doesn't exist but still...) > Looks much better now. Pleas

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-20 Thread Andi Gutmans
Looks much better now. Please make sure you test it well because it's quite sensitive APIs you are using. About the return value, I think it should return the error message or true on success. Then people could use === to check what they got (I prefer that over Markus' idea). Then again I'm not

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Markus Fischer
On Wed, Nov 19, 2003 at 03:18:34PM -0500, Ilia Alshanetsky wrote : > On November 19, 2003 02:40 pm, Markus Fischer wrote: > > bool php_check_syntax($filename [, &$error_message]); > > I'll need to look at the code, it should be possible to do. Although I'd > prefer to have it return the erro

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Ilia Alshanetsky
Here is the revised patch. It is now much cleaner (no more lexer stuff) and supports few additional features. By popular demand the functions have been renamed to php_check_syntax() & php_strip_whitespace(). php_check_syntax() can now handle remote scripts and if a 2nd (optional) argument is pa

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Jani Taskinen
On Wed, 19 Nov 2003, Andi Gutmans wrote: >At 02:23 PM 11/19/2003 -0500, Ilia Alshanetsky wrote: >> > IMHO it should be php_check_syntax() and not >> > script_check_syntax() to make clear what it actualy >> > checks (it won't check the syntax of my shell, awk >> > or perl scripts, would it? ;) >> >

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Wez Furlong
It should work out of the box. --Wez. > > As a sidenote, would streams be supported (http, ftp) ? Or are there > > some kind of limitating factors? > > That should be possible as well. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Ilia Alshanetsky
On November 19, 2003 02:40 pm, Markus Fischer wrote: > bool php_check_syntax($filename [, &$error_message]); I'll need to look at the code, it should be possible to do. Although I'd prefer to have it return the error rather then return it by reference as an optional argument. > As a

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Markus Fischer
On Wed, Nov 19, 2003 at 11:24:56AM -0500, Ilia Alshanetsky wrote : > Attached file, implements validate_file(), which implements a php space syntax > check for PHP scripts. It returns a boolean true/false value indicating > whether the script has parse errors or not. Essentially a "php -l" from

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Hans Zaunere
Andi Gutmans wrote: At 02:23 PM 11/19/2003 -0500, Ilia Alshanetsky wrote: > IMHO it should be php_check_syntax() and not > script_check_syntax() to make clear what it actualy > checks (it won't check the syntax of my shell, awk > or perl scripts, would it? ;) Good idea, we already have some fun

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Ilia Alshanetsky
On November 19, 2003 02:44 pm, Andi Gutmans wrote: > I hate the name lint and strip is kind of too short. > Why not keep it long like Hartmut suggested such as php_check_syntax(), > php_strip_whitespace()? Those names are fine too (personally, I dislike overly long function names, they are harder

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Andi Gutmans
At 02:23 PM 11/19/2003 -0500, Ilia Alshanetsky wrote: > IMHO it should be php_check_syntax() and not > script_check_syntax() to make clear what it actualy > checks (it won't check the syntax of my shell, awk > or perl scripts, would it? ;) Good idea, we already have some function that utilize php_

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Andi Gutmans
At 08:11 PM 11/19/2003 +0100, Hartmut Holzgraefe wrote: Ilia Alshanetsky wrote: script_* is good, I have no naming preference. I am more interested to know whether this functionality is something we need or not... it is not needed, you can just do system("php -l filename"); instead ;) actuall

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Jon Parise
On Wed, Nov 19, 2003 at 02:23:44PM -0500, Ilia Alshanetsky wrote: > Good idea, we already have some function that utilize php_ prefix, might as > well continue with the trend. How about php_lint() & php_strip()? php_lint() sounds goodr, and I'm cool with either php_strip() or php_strip_whitespa

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Ilia Alshanetsky
On November 19, 2003 02:11 pm, Hartmut Holzgraefe wrote: > Ilia Alshanetsky wrote: > > script_* is good, I have no naming preference. I am more interested to > > know whether this functionality is something we need or not... > > it is not needed, you can just do > >system("php -l filename"); >

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Hartmut Holzgraefe
Ilia Alshanetsky wrote: script_* is good, I have no naming preference. I am more interested to know whether this functionality is something we need or not... it is not needed, you can just do system("php -l filename"); instead ;) actually i would love to have php_check_syntax() as it would si

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Ilia Alshanetsky
On November 19, 2003 01:33 pm, Andi Gutmans wrote: > If we're talking about naming the how about script_*? script_* is good, I have no naming preference. I am more interested to know whether this functionality is something we need or not... Ilia -- PHP Internals - PHP Runtime Development Maili

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Andi Gutmans
At 05:30 PM 11/19/2003 +0100, Jan Lehnardt wrote: Hi, On 19 Nov 2003, at 17:24, Ilia Alshanetsky wrote: Any comments? I find that useful for something I am writing right now and I was about to propose that myself :). I'd go for php_check_syntax() or at least file_validate() and php_strip_whitespace

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Andi Gutmans
I think it's a very bad idea to start copying lexer code into basic_functions.c I don't have time to look into it but there must be a cleaner way of doing it. Andi At 11:24 AM 11/19/2003 -0500, Ilia Alshanetsky wrote: Attached file, implements validate_file(), which implements a php space syntax

Re: [PHP-DEV] validate_file() and strip_file()

2003-11-19 Thread Jan Lehnardt
Hi, On 19 Nov 2003, at 17:24, Ilia Alshanetsky wrote: Any comments? I find that useful for something I am writing right now and I was about to propose that myself :). I'd go for php_check_syntax() or at least file_validate() and php_strip_whitespace() or at least file_strip_whitespace(), but that'