rendered paste body#!/bin/bashREPOS="$1"TXN="$2"PHP="/usr/bin/php"SVNLOOK=/usr/bin/svnlookCHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | awk '{print $2}'`for LINE in $CHANGED do FILE=`echo $LINE | egrep \\.php$` if [ $? == 0 ] then MESSAGE=`$SVNLOOK cat -t "$TXN" "$REPOS" "${FILE}" | $PHP -l` if [ $? -ne 0 ] then echo " " 1>&2 echo "---------------------------------------------------------------------------------" 1>&2 echo "During automatic PHP syntax checking we found an error in the following PHP file: " 1>&2 echo " " 1>&2 echo "${FILE}: $MESSAGE" | sed "s| -| $FILE|g" 1>&2 echo " " 1>&2 echo "Please correct the error and try commit again." 1>&2 echo " " 1>&2 echo "You can check for syntax error on your computer by running command: php -l ${FILE}" 1>&2 echo " " 1>&2 echo "Best regards," 1>&2 echo "QA team" 1>&2 echo "---------------------------------------------------------------------------------" 1>&2 exit 1 fi fi done