Req #62544 [Com]: A function alternative to "php -l"

2012-07-15 Thread reeze dot xia at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62544&edit=1

 ID: 62544
 Comment by: reeze dot xia at gmail dot com
 Reported by:narf at bofh dot bg
 Summary:A function alternative to "php -l"
 Status: Open
 Type:   Feature/Change Request
 Package:Unknown/Other Function
 Operating System:   Irrelevant
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Yes, I could like it back too.
So +1 for this request :)


Previous Comments:

[2012-07-15 15:01:50] narf at bofh dot bg

So, it used to exist, but due to poor design and implementation it's removed 
instead of fixed and we're forced to create hacks? This doesn't sound smart.


[2012-07-15 14:24:33] reeze dot xia at gmail dot com

There ever a function for this: http://php.net/manual/en/function.php-check-
syntax.php (you  could take a look at those user-land implementations in User 
Contributed Notes sectiion)

php_check_syntax(), it was removed after 5.0.5.
the reason is here: https://bugs.php.net/bug.php?id=27406


[2012-07-12 19:53:34] narf at bofh dot bg

Description:

Currently, there's no way to do a syntax check from within a script (unless we 
do something like `/usr/bin/php -l /path/to/script.php`) and there deffinately 
are use cases for such a feature.

Considering that the actual checking logic is already available, it shouldn't 
be hard at all to make a function alternative to it.

Here's what the function description would look like:

bool php_syntax_check( string $target [, bool $raw_code = FALSE] )

$target is the script file path, unless $raw_code is set to TRUE. In the latter 
case - $target is raw php code, as it would be passed to eval().







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62544&edit=1


Req #62544 [Com]: A function alternative to "php -l"

2012-07-15 Thread narf at bofh dot bg
Edit report at https://bugs.php.net/bug.php?id=62544&edit=1

 ID: 62544
 Comment by: narf at bofh dot bg
 Reported by:narf at bofh dot bg
 Summary:A function alternative to "php -l"
 Status: Open
 Type:   Feature/Change Request
 Package:Unknown/Other Function
 Operating System:   Irrelevant
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

So, it used to exist, but due to poor design and implementation it's removed 
instead of fixed and we're forced to create hacks? This doesn't sound smart.


Previous Comments:

[2012-07-15 14:24:33] reeze dot xia at gmail dot com

There ever a function for this: http://php.net/manual/en/function.php-check-
syntax.php (you  could take a look at those user-land implementations in User 
Contributed Notes sectiion)

php_check_syntax(), it was removed after 5.0.5.
the reason is here: https://bugs.php.net/bug.php?id=27406


[2012-07-12 19:53:34] narf at bofh dot bg

Description:

Currently, there's no way to do a syntax check from within a script (unless we 
do something like `/usr/bin/php -l /path/to/script.php`) and there deffinately 
are use cases for such a feature.

Considering that the actual checking logic is already available, it shouldn't 
be hard at all to make a function alternative to it.

Here's what the function description would look like:

bool php_syntax_check( string $target [, bool $raw_code = FALSE] )

$target is the script file path, unless $raw_code is set to TRUE. In the latter 
case - $target is raw php code, as it would be passed to eval().







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62544&edit=1


Req #62544 [Com]: A function alternative to "php -l"

2012-07-15 Thread reeze dot xia at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62544&edit=1

 ID: 62544
 Comment by: reeze dot xia at gmail dot com
 Reported by:narf at bofh dot bg
 Summary:A function alternative to "php -l"
 Status: Open
 Type:   Feature/Change Request
 Package:Unknown/Other Function
 Operating System:   Irrelevant
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

There ever a function for this: http://php.net/manual/en/function.php-check-
syntax.php (you  could take a look at those user-land implementations in User 
Contributed Notes sectiion)

php_check_syntax(), it was removed after 5.0.5.
the reason is here: https://bugs.php.net/bug.php?id=27406


Previous Comments:

[2012-07-12 19:53:34] narf at bofh dot bg

Description:

Currently, there's no way to do a syntax check from within a script (unless we 
do something like `/usr/bin/php -l /path/to/script.php`) and there deffinately 
are use cases for such a feature.

Considering that the actual checking logic is already available, it shouldn't 
be hard at all to make a function alternative to it.

Here's what the function description would look like:

bool php_syntax_check( string $target [, bool $raw_code = FALSE] )

$target is the script file path, unless $raw_code is set to TRUE. In the latter 
case - $target is raw php code, as it would be passed to eval().







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62544&edit=1