On Thu, Apr 15, 2010 at 9:13 AM, CM Lubinski cmc333333@gmail.com wrote:
If you are worried about syntactic errors (rather than logical ones), you can also run your code through php's lint.
$ php -l mymodule.php
Unfortunately, this only handles one file at a time, but it will tell you if the code can be included at all.
Command line fun to the rescue:
$ find ./ -type f -exec php -l {} ;
That command: 1. Finds items in the current directory and subdirectories 2. That are "type f" (i.e. files) 3. And executes a new php -l function on each file it finds
I keep that in a script called "phpchecker" in my ~/bin/ directory and frequently use it prior to making a commit or a tag on code.
Cheers, Greg