aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-04-04 00:27:06 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2012-04-04 00:27:06 -0400
commit6536a36208b3a2ecebaf5ab8e93f63b84127ae3f (patch)
treedac9998973cbd18bd47631b137d169f205a7215d /git-tools
parent[ticket/10760] Catch both versions of parse error output in php. (diff)
downloadphpbb-6536a36208b3a2ecebaf5ab8e93f63b84127ae3f.tar.gz
phpbb-6536a36208b3a2ecebaf5ab8e93f63b84127ae3f.tar.bz2
phpbb-6536a36208b3a2ecebaf5ab8e93f63b84127ae3f.zip
[ticket/10760] PHP is great. This commit is the proof.
PHPBB3-10760
Diffstat (limited to 'git-tools')
-rwxr-xr-xgit-tools/hooks/pre-commit24
1 files changed, 24 insertions, 0 deletions
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit
index bb667bf8ff..9e78edd90d 100755
--- a/git-tools/hooks/pre-commit
+++ b/git-tools/hooks/pre-commit
@@ -101,6 +101,30 @@ then
# 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.
+ #
+ # other fun php facts:
+ #
+ # 1. in cli, display_errors and log_errors have different
+ # destinations by default. display_errors prints to
+ # standard output and log_errors prints to standard error.
+ # whether these destinations make sense is left
+ # as an exercise for the reader.
+ # 2. as mentioned above, with all output turned on
+ # php will print parse errors twice, one time on stdout
+ # and one time on stderr.
+ # 2. it is possible to set both display_errors and log_errors
+ # to off. if this is done php will print the text
+ # "Errors parsing <file>" but will not say what
+ # the errors are. useful behavior, this.
+ # 3. on my system display_errors defaults to on and
+ # log_errors defaults to off, therefore providing
+ # by default one copy of messages. your mileage may vary.
+ # 4. by setting display_errors=stderr and log_errors=on,
+ # both sets of messages will be printed on stderr.
+ # 5. php-cgi binary, given display_errors=stderr and
+ # log_errors=on, still prints both sets of messages
+ # on stderr, but formats one set as an html fragment.
+ # 6. your entry here? ;)
$echo_e "$errors" | grep "^Parse error:"
if [ $? -ne 0 ]
then