wiki.techinc.nl/maintenance/dev/includes/php.sh
Southparkfan e930012075 Revert "Add executable rights for executable (bash) files"
These are not meant to be complete shell scripts, so
shebang lines don't really make sense here. Rather, as
noted by the author (Daniel Friesen), scripts in the
parent directory include these files using the "source"
or "." command.

This reverts commit 96e0ed45a8.

Change-Id: I7a0b7bb2a5ea1b1c141cb36f38736fe562b22c10
2015-08-07 07:28:19 +00:00

14 lines
538 B
Bash

# Include-able script to determine the location of our php if any
# 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
for binary in $PHP $(which php || true) "$DEV/php/bin/php" "$HOME/.mediawiki/php/bin/php" "$HOME/.mwphp/bin/php" ]; do
if [ -x "$binary" ]; then
if "$binary" -r 'exit((int)!version_compare(PHP_VERSION, "5.4", ">="));'; then
PHP="$binary"
break
fi
fi
done