X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fdev%2Finstallphp.sh;h=1e3d410f148ca0064c75167af155d74b9e627a39;hb=fac86a2fcf4d357b492847f6ca25f85a571e9341;hp=51023619cc5c2f61a92234af6c850457eab3c526;hpb=f03373cf1e6c436c7b4bfdbfecc95d44084d9dc4;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dev/installphp.sh b/maintenance/dev/installphp.sh index 51023619cc..1e3d410f14 100755 --- a/maintenance/dev/installphp.sh +++ b/maintenance/dev/installphp.sh @@ -5,51 +5,54 @@ DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) set -e # DO NOT USE PIPES unless this is rewritten -if [ -d "$DEV/php" -a -x "$DEV/php/bin/php" ] || [ -d "$HOME/.mwphp" -a -x "$HOME/.mwphp/bin/php" ]; then +. "$DEV/includes/php.sh" + +if [ "x$PHP" != "x" -a -x "$PHP" ]; then echo "PHP is already installed" exit 0 fi -TAR=php5.4-latest.tar.gz -PHPURL="http://snaps.php.net/$TAR" +VER=5.6.32 +TAR="php-$VER.tar.gz" +PHPURL="https://secure.php.net/get/$TAR/from/this/mirror" cd "$DEV" -echo "Preparing to download and install a local copy of PHP 5.4, note that this can take some time to do." -echo "If you wish to avoid re-doing this for uture dev installations of MediaWiki we suggest installing php in ~/.mwphp" -echo -n "Install PHP in ~/.mwphp [y/N]: " +echo "Preparing to download and install a local copy of PHP $VER, note that this can take some time to do." +echo "If you wish to avoid re-doing this for future dev installations of MediaWiki we suggest installing php in ~/.mediawiki/php" +echo -n "Install PHP in ~/.mediawiki/php [y/N]: " read INSTALLINHOME case "$INSTALLINHOME" in [Yy] | [Yy][Ee][Ss] ) - PREFIX="$HOME/.mwphp" + PREFIX="$HOME/.mediawiki/php" ;; *) PREFIX="$DEV/php/" ;; esac -# Some debain-like systems bundle wget but not curl, some other systems +# Some debian-like systems bundle wget but not curl, some other systems # like os x bundle curl but not wget... use whatever is available -echo -n "Downloading PHP 5.4" +echo -n "Downloading PHP $VER" if command -v wget &>/dev/null; then - echo "- using wget" - wget "$PHPURL" + echo " - using wget" + wget -O "$TAR" "$PHPURL" elif command -v curl &>/dev/null; then - echo "- using curl" - curl -O "$PHPURL" + echo " - using curl" + curl "$PHPURL" -L -o "$TAR" else - echo "- aborting" + echo " - aborting" echo "Could not find curl or wget." >&2; exit 1; fi -echo "Extracting php 5.4" +echo "Extracting php $VER" tar -xzf "$TAR" -cd php5.4-*/ +cd "php-$VER/" -echo "Configuring and installing php 5.4 in $PREFIX" +echo "Configuring and installing php $VER in $PREFIX" ./configure --prefix="$PREFIX" make make install