Created
December 7, 2012 04:38
-
-
Save jtarleton/4230797 to your computer and use it in GitHub Desktop.
Lint all PHP source files in a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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