From 856310a705b7648da1c0cebb67fb13099fd6cbc5 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Sun, 11 Dec 2011 19:45:15 +0000 Subject: [PATCH] Follow up r102210: - Update maintenance/dev/ to install php inside ~/.mediawiki/php instead of ~/.mwphp - Tweak README a bit - Move the router.php into an includes along with two helper .sh files to cut out some of the repetition --- maintenance/dev/README | 2 +- maintenance/dev/{ => includes}/router.php | 0 maintenance/dev/installmw.sh | 9 +-------- maintenance/dev/installphp.sh | 10 ++++++---- maintenance/dev/start.sh | 11 ++--------- 5 files changed, 10 insertions(+), 22 deletions(-) rename maintenance/dev/{ => includes}/router.php (100%) diff --git a/maintenance/dev/README b/maintenance/dev/README index d386167bb7..ca47d13654 100644 --- a/maintenance/dev/README +++ b/maintenance/dev/README @@ -1,6 +1,6 @@ maintenance/dev/ scripts can help quickly setup a local MediaWiki for development purposes. -Wikis setup in this way are NOT meant to be publicly available. They use a development database not acceptible for use in production and place a sqlite database in an unsafe location a real wiki should never place it in. +Wikis setup in this way are NOT meant to be publicly available. They use a development database not acceptible for use in production. Place a sqlite database in an unsafe location a real wiki should never place it in. And use predictable default logins for the initial administrator user. Running maintenance/dev/install.sh will download and install a local copy of php 5.4, install a sqlite powered instance of MW for development, and then start up a local webserver to view the wiki. diff --git a/maintenance/dev/router.php b/maintenance/dev/includes/router.php similarity index 100% rename from maintenance/dev/router.php rename to maintenance/dev/includes/router.php diff --git a/maintenance/dev/installmw.sh b/maintenance/dev/installmw.sh index 7e352b6109..9ae3c593de 100755 --- a/maintenance/dev/installmw.sh +++ b/maintenance/dev/installmw.sh @@ -3,14 +3,7 @@ if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) -if [ -d "$DEV/php" -a -x "$DEV/php/bin/php" ]; then - PHP="$DEV/php/bin/php" -elif [ -d "$HOME/.mwphp" -a -x "$HOME/.mwphp/bin/php" ]; then - PHP="$HOME/.mwphp/bin/php" -else - echo "Local copy of PHP is not installed" - echo 1 -fi +. "$DEV/includes/require-php.sh" set -e diff --git a/maintenance/dev/installphp.sh b/maintenance/dev/installphp.sh index 51023619cc..d26ffa67f7 100755 --- a/maintenance/dev/installphp.sh +++ b/maintenance/dev/installphp.sh @@ -5,7 +5,9 @@ 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 @@ -16,13 +18,13 @@ PHPURL="http://snaps.php.net/$TAR" 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 "If you wish to avoid re-doing this for uture 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/" diff --git a/maintenance/dev/start.sh b/maintenance/dev/start.sh index 43b2daeb23..dd7363a8f2 100755 --- a/maintenance/dev/start.sh +++ b/maintenance/dev/start.sh @@ -3,14 +3,7 @@ if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) -if [ -d "$DEV/php" -a -x "$DEV/php/bin/php" ]; then - PHP="$DEV/php/bin/php" -elif [ -d "$HOME/.mwphp" -a -x "$HOME/.mwphp/bin/php" ]; then - PHP="$HOME/.mwphp/bin/php" -else - echo "Local copy of PHP is not installed" - echo 1 -fi +. "$DEV/includes/require-php.sh" PORT=4881 @@ -18,4 +11,4 @@ echo "Starting up MediaWiki at http://localhost:$PORT/" echo "" cd "$DEV/../../"; # $IP -"$PHP" -S "localhost:$PORT" "$DEV/router.php" +"$PHP" -S "localhost:$PORT" "$DEV/includes/router.php" -- 2.20.1