php.sh 538 B

1234567891011121314
  1. # Include-able script to determine the location of our php if any
  2. # We search for a environment var called PHP, native php,
  3. # a local copy, home directory location used by installphp.sh
  4. # and previous home directory location
  5. # The binary path is returned in $PHP if any
  6. for binary in $PHP $(which php || true) "$DEV/php/bin/php" "$HOME/.mediawiki/php/bin/php" "$HOME/.mwphp/bin/php" ]; do
  7. if [ -x "$binary" ]; then
  8. if "$binary" -r 'exit((int)!version_compare(PHP_VERSION, "5.4", ">="));'; then
  9. PHP="$binary"
  10. break
  11. fi
  12. fi
  13. done