summaryrefslogtreecommitdiff
path: root/www/wiki/maintenance/dev/includes/php.sh
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/maintenance/dev/includes/php.sh')
-rw-r--r--www/wiki/maintenance/dev/includes/php.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/www/wiki/maintenance/dev/includes/php.sh b/www/wiki/maintenance/dev/includes/php.sh
new file mode 100644
index 00000000..3c5bef0d
--- /dev/null
+++ b/www/wiki/maintenance/dev/includes/php.sh
@@ -0,0 +1,14 @@
+# 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