Skip to content

Commit

Permalink
Add PHP lint helper
Browse files Browse the repository at this point in the history
  • Loading branch information
helhum committed May 8, 2013
1 parent e133c68 commit 7cf7ceb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions install-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,25 @@ function installRedis() {
cd $_pwd
}

function phpLint {
for file in `find . -name \*.php`
do
echo -en "\r\033[KChecking: $file"
if ! php -l $file > /dev/null
then
echo -en "\r\033[K"
echo -e "\e[00;31mSyntax errors detected in file: $file\e[00m"
ERR=1
[ -z "$1" ] && break
fi
done

echo -e "\r\033[K"

if [ -n "$ERR" ]
then
return 99
fi

return 0
}

0 comments on commit 7cf7ceb

Please sign in to comment.