From: addshore Date: Wed, 11 Jan 2017 22:22:07 +0000 (-0800) Subject: phan: Don't hardcode 'php7.0' binary X-Git-Tag: 1.31.0-rc.0~4339^2 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=38376facc699841b630cce0f45d408d61734a626;p=lhc%2Fweb%2Fwiklou.git phan: Don't hardcode 'php7.0' binary This isn't available on all systems, e.g. Fedora just uses "php". People with multiple versions of PHP installed can use an alternatives system or something to make sure PHP 7 is used. Change-Id: I03ef7c2d4223ade32f7a89c3a88706ae8c6e8156 --- diff --git a/tests/phan/bin/phan b/tests/phan/bin/phan index 61ad7da969..ad06823abf 100755 --- a/tests/phan/bin/phan +++ b/tests/phan/bin/phan @@ -7,6 +7,12 @@ if ! which realpath > /dev/null; then } fi +if hash php7.0 2>/dev/null; then + export PHP="php7.0" +else + export PHP="php" +fi + # Note that this isn't loaded in via composer because then composer can # only be run with php7.0 if [ ! -f "$PHAN" ]; then @@ -19,7 +25,7 @@ if [ ! -f "$PHAN" ]; then exit 1 fi else - export PHAN="php7.0 $PHAN" + export PHAN="$PHP $PHAN" fi if [ -z "$MW_INSTALL_PATH" ]; then