On 12/12/06, Nico Edtinger <[EMAIL PROTECTED]> wrote:
[12.12.2006 16:26] Joe Kramer wrote:
> There is no "compile php", you can only do "php -f" to parse single
> file.
There is a syntax checker (lint) built into php with "php -l". -f
does also execute the file.
> Probably can be automated using some script to parse every file in
> whole project tree.
find . -name "*.php" -exec php -l {} \; | grep -v "^No syntax errors
detected"
Personnaly i use phing to check syntax of my project:
<target name="lint">
<phplint>
<fileset dir=".">
<exclude name="${docdir}/**" />
<exclude name="${report_test_dir}/**" />
<include name="**/*.php"/>
</fileset>
</phplint>
</target>
And in my project we use a subversion hook to disallow commit of php
file with syntax error.