aboutsummaryrefslogtreecommitdiffstats
path: root/git-tools
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-04-04 00:01:08 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2012-04-04 00:01:08 -0400
commitf2967b666974c6622717a064060e546129e11e37 (patch)
tree9da6bd816310f989eb6c60b03f227e23d65f5ec8 /git-tools
parenta0da2408e7cb0054da5d766bffa91f23d7beaec9 (diff)
downloadforums-f2967b666974c6622717a064060e546129e11e37.tar
forums-f2967b666974c6622717a064060e546129e11e37.tar.gz
forums-f2967b666974c6622717a064060e546129e11e37.tar.bz2
forums-f2967b666974c6622717a064060e546129e11e37.tar.xz
forums-f2967b666974c6622717a064060e546129e11e37.zip
[ticket/10760] Catch both versions of parse error output in php.
PHPBB3-10760
Diffstat (limited to 'git-tools')
-rwxr-xr-xgit-tools/hooks/pre-commit14
1 files changed, 14 insertions, 0 deletions
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit
index a0c2b6b247..bb667bf8ff 100755
--- a/git-tools/hooks/pre-commit
+++ b/git-tools/hooks/pre-commit
@@ -92,6 +92,20 @@ unset IFS
if [ $error -eq 1 ]
then
echo "PHP Syntax check failed:"
+ # php "display errors" (display_errors php.ini value)
+ # and "log errors" (log_errors php.ini value).
+ # these are independent settings - see main/main.c in php source.
+ # the "log errors" setting produces output which
+ # starts with "PHP Parse error:"; the "display errors"
+ # setting produces output starting with "Parse error:".
+ # if both are turned on php dumps the parse error twice.
+ # therefore here we try to grep for one version and
+ # if that yields no results grep for the other version.
$echo_e "$errors" | grep "^Parse error:"
+ if [ $? -ne 0 ]
+ then
+ # match failed
+ $echo_e "$errors" | grep "^PHP Parse error:"
+ fi
exit 1
fi