From 7cf7ceb9cb0156d380718287ab00172f2518eefe Mon Sep 17 00:00:00 2001 From: Helmut Hummel Date: Wed, 8 May 2013 23:21:03 +0200 Subject: [PATCH] Add PHP lint helper --- install-helper.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/install-helper.sh b/install-helper.sh index 27a7a6b..61d0670 100755 --- a/install-helper.sh +++ b/install-helper.sh @@ -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 +}