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
/bin/echo on freebsd and dash's builtin echo do not understand -e,
therefore -e is printed with the other messages in such cases.
Test if echo understands -e, if not do not use it.
PHPBB3-10760
We have a PHP_BIN variable but we always set it unconditionally,
therefore in order to use a different php binary one had to
modify the hook script.
Instead set PHP_BIN if it is not set.
Now one can set PHP_BIN in their environment to use a non-default
php binary.
PHPBB3-10760
One major issue with the pre-hook so far was partially staged files,
because it used filenames for php lint. These changes will make the hook read the file contents from the index instead.
Great thanks to David Soria Parra.
This pre-commit hook utilises PHP's command-line -l (lint) option, which
checks for syntax errors. In case of an error the commit is rejected and
the error displayed.
Testing is welcome.