mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/10760] Use externally specified PHP_BIN if any.
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
This commit is contained in:
parent
14e727b834
commit
57209a1e68
1 changed files with 5 additions and 3 deletions
|
@ -12,8 +12,10 @@
|
||||||
# ln -s ../../git-tools/hooks/pre-commit \\
|
# ln -s ../../git-tools/hooks/pre-commit \\
|
||||||
# .git/hooks/pre-commit
|
# .git/hooks/pre-commit
|
||||||
|
|
||||||
# NOTE: this is run through /usr/bin/env
|
if [ -z "$PHP_BIN" ]
|
||||||
|
then
|
||||||
PHP_BIN=php
|
PHP_BIN=php
|
||||||
|
fi
|
||||||
|
|
||||||
# necessary check for initial commit
|
# necessary check for initial commit
|
||||||
if git rev-parse --verify HEAD >/dev/null 2>&1
|
if git rev-parse --verify HEAD >/dev/null 2>&1
|
||||||
|
@ -64,7 +66,7 @@ do
|
||||||
|
|
||||||
# check the staged file content for syntax errors
|
# check the staged file content for syntax errors
|
||||||
# using php -l (lint)
|
# using php -l (lint)
|
||||||
result=$(git cat-file -p $sha | /usr/bin/env $PHP_BIN -l 2>/dev/null)
|
result=$(git cat-file -p $sha | $PHP_BIN -l 2>/dev/null)
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
error=1
|
error=1
|
||||||
|
|
Loading…
Add table
Reference in a new issue