From 38376facc699841b630cce0f45d408d61734a626 Mon Sep 17 00:00:00 2001 From: addshore Date: Wed, 11 Jan 2017 14:22:07 -0800 Subject: [PATCH] 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 --- tests/phan/bin/phan | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.20.1