Skip to content

Instantly share code, notes, and snippets.

@jtarleton
Created December 7, 2012 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtarleton/4230797 to your computer and use it in GitHub Desktop.
Save jtarleton/4230797 to your computer and use it in GitHub Desktop.
Lint all PHP source files in a directory
<?php
$dh = opendir('.');
while (false !== ($filename = readdir($dh)))
{
$files[] = $filename;
}
sort($files);
foreach( $files as $file)
{
if(
preg_match( '/.php$/',$file) || preg_match( '/.inc$/',$file) )
{
echo shell_exec("php -l $file");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment