2011-12-11 19:49:16 +00:00
|
|
|
# Include-able script to determine the location of our php if any
|
2012-07-27 17:00:40 +00:00
|
|
|
# We search for a environment var called PHP, native php,
|
|
|
|
|
# a local copy, home directory location used by installphp.sh
|
|
|
|
|
# and previous home directory location
|
|
|
|
|
# The binary path is returned in $PHP if any
|
2011-12-11 19:49:16 +00:00
|
|
|
|
2014-04-01 12:17:22 +00:00
|
|
|
for binary in $PHP $(which php || true) "$DEV/php/bin/php" "$HOME/.mediawiki/php/bin/php" "$HOME/.mwphp/bin/php" ]; do
|
2012-07-27 17:00:40 +00:00
|
|
|
if [ -x "$binary" ]; then
|
2012-08-06 05:56:16 +00:00
|
|
|
if "$binary" -r 'exit((int)!version_compare(PHP_VERSION, "5.4", ">="));'; then
|
2012-07-27 17:00:40 +00:00
|
|
|
PHP="$binary"
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
done
|