find parse errors in php file without executing it [SOLVED]
Posted: Wed May 14, 2008 12:10 am
How can I do this on windows? I do have php accessible from the command line.http://shiflett.org/blog/2007/dec/php-advent-calendar-day-17 wrote:This command searches through the /path/to/code directory for all files with a .php extension (adjust as necessary to match your own naming conventions; add another extension such as .inc by appending -o -name \*.inc to the find command) and passes them one at a time to PHP's CLI binary with -l to indicate lint mode. In this mode, the file is parsed but not executed, and any existing parse errors will be identified. The scripts stops execution if a parse error is encountered.Code: Select all
find /path/to/code -name \*.php | xargs -n1 php -l
EDIT| I just want to do one file, not a directory.