From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- maintenance/dev/README | 7 +++ maintenance/dev/includes/php.sh | 12 +++++ maintenance/dev/includes/require-php.sh | 8 ++++ maintenance/dev/includes/router.php | 82 +++++++++++++++++++++++++++++++++ maintenance/dev/install.sh | 8 ++++ maintenance/dev/installmw.sh | 18 ++++++++ maintenance/dev/installphp.sh | 57 +++++++++++++++++++++++ maintenance/dev/start.sh | 14 ++++++ 8 files changed, 206 insertions(+) create mode 100644 maintenance/dev/README create mode 100644 maintenance/dev/includes/php.sh create mode 100644 maintenance/dev/includes/require-php.sh create mode 100644 maintenance/dev/includes/router.php create mode 100644 maintenance/dev/install.sh create mode 100644 maintenance/dev/installmw.sh create mode 100644 maintenance/dev/installphp.sh create mode 100644 maintenance/dev/start.sh (limited to 'maintenance/dev') diff --git a/maintenance/dev/README b/maintenance/dev/README new file mode 100644 index 00000000..ca47d136 --- /dev/null +++ b/maintenance/dev/README @@ -0,0 +1,7 @@ +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. 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. + +After installation you can bring the webserver back up at any time you want with maintenance/dev/start.sh diff --git a/maintenance/dev/includes/php.sh b/maintenance/dev/includes/php.sh new file mode 100644 index 00000000..3021b93b --- /dev/null +++ b/maintenance/dev/includes/php.sh @@ -0,0 +1,12 @@ +# Include-able script to determine the location of our php if any + +if [ -d "$DEV/php" -a -x "$DEV/php/bin/php" ]; then + # Quick local copy + PHP="$DEV/php/bin/php" +elif [ -d "$HOME/.mediawiki/php" -a -x "$HOME/.mediawiki/php/bin/php" ]; then + # Previous home directory location to install php in + PHP="$HOME/.mediawiki/php/bin/php" +elif [ -d "$HOME/.mwphp" -a -x "$HOME/.mwphp/bin/php" ]; then + # Previous home directory location to install php in + PHP="$HOME/.mwphp/bin/php" +fi diff --git a/maintenance/dev/includes/require-php.sh b/maintenance/dev/includes/require-php.sh new file mode 100644 index 00000000..470e6eb8 --- /dev/null +++ b/maintenance/dev/includes/require-php.sh @@ -0,0 +1,8 @@ +# Include-able script to require that we have a known php binary we can execute + +. "$DEV/includes/php.sh" + +if [ "x$PHP" == "x" -o ! -x "$PHP" ]; then + echo "Local copy of PHP is not installed" + exit 1 +fi diff --git a/maintenance/dev/includes/router.php b/maintenance/dev/includes/router.php new file mode 100644 index 00000000..f6a062b6 --- /dev/null +++ b/maintenance/dev/includes/router.php @@ -0,0 +1,82 @@ +/dev/null; then + echo "- using wget" + wget "$PHPURL" +elif command -v curl &>/dev/null; then + echo "- using curl" + curl -O "$PHPURL" +else + echo "- aborting" + echo "Could not find curl or wget." >&2; + exit 1; +fi + +echo "Extracting php 5.4" +tar -xzf "$TAR" + +cd php5.4-*/ + +echo "Configuring and installing php 5.4 in $PREFIX" +./configure --prefix="$PREFIX" +make +make install diff --git a/maintenance/dev/start.sh b/maintenance/dev/start.sh new file mode 100644 index 00000000..dd7363a8 --- /dev/null +++ b/maintenance/dev/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi +DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) + +. "$DEV/includes/require-php.sh" + +PORT=4881 + +echo "Starting up MediaWiki at http://localhost:$PORT/" +echo "" + +cd "$DEV/../../"; # $IP +"$PHP" -S "localhost:$PORT" "$DEV/includes/router.php" -- cgit v1.2.2