1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-18 22:58:10 +01:00

[ticket/10760] Account for display_errors=stderr in pre-commit hook.

With that php.ini value set errors are printed to stderr, therefore
by redirecting stderr to /dev/null we also throw out the errors.

Instead merge stderr into stdout.

PHPBB3-10760
This commit is contained in:
Oleg Pudeyev 2012-04-03 23:18:33 -04:00
parent b803fc4351
commit a0da2408e7

View File

@ -73,7 +73,13 @@ do
# check the staged file content for syntax errors
# using php -l (lint)
result=$(git cat-file -p $sha | "$PHP_BIN" -l 2>/dev/null)
# note: if display_errors=stderr in php.ini,
# parse errors are printed on stderr; otherwise
# they are printed on stdout.
# we filter everything other than parse errors
# with a grep below, therefore it should be safe
# to combine stdout and stderr in all circumstances
result=$(git cat-file -p $sha | "$PHP_BIN" -l 2>&1)
if [ $? -ne 0 ]
then
error=1