https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102201
Revision: 102201
Author: dantman
Date: 2011-11-06 22:50:32 +0000 (Sun, 06 Nov 2011)
Log Message:
-----------
Commit maintenance/dev/ a set of bash scripts that can quickly download php
5.4, install it in an isolated area, install a quick development copy of
MediaWiki, and then start up a local webserver.
Added Paths:
-----------
trunk/phase3/maintenance/dev/
trunk/phase3/maintenance/dev/README
trunk/phase3/maintenance/dev/install.sh
trunk/phase3/maintenance/dev/installmw.sh
trunk/phase3/maintenance/dev/installphp.sh
trunk/phase3/maintenance/dev/start.sh
Added: trunk/phase3/maintenance/dev/README
===================================================================
--- trunk/phase3/maintenance/dev/README (rev 0)
+++ trunk/phase3/maintenance/dev/README 2011-11-06 22:50:32 UTC (rev 102201)
@@ -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 and place a sqlite
database in an unsafe location a real wiki should never place it in.
+
+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
Added: trunk/phase3/maintenance/dev/install.sh
===================================================================
--- trunk/phase3/maintenance/dev/install.sh (rev 0)
+++ trunk/phase3/maintenance/dev/install.sh 2011-11-06 22:50:32 UTC (rev
102201)
@@ -0,0 +1,8 @@
+#!/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/installphp.sh
+$DEV/installmw.sh
+$DEV/start.sh
Property changes on: trunk/phase3/maintenance/dev/install.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/phase3/maintenance/dev/installmw.sh
===================================================================
--- trunk/phase3/maintenance/dev/installmw.sh (rev 0)
+++ trunk/phase3/maintenance/dev/installmw.sh 2011-11-06 22:50:32 UTC (rev
102201)
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi
+DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
+
+set -e
+
+PORT=4881
+
+cd $DEV/../../; # $IP
+
+mkdir $DEV/data
+$DEV/php/bin/php maintenance/install.php --server="http://localhost:$PORT"
--scriptpath="" --dbtype=sqlite --dbpath=$DEV/data --pass=admin "Trunk Test"
$USER
+echo ""
+echo "Development wiki created with admin user $USER and password 'admin'."
+echo ""
Property changes on: trunk/phase3/maintenance/dev/installmw.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/phase3/maintenance/dev/installphp.sh
===================================================================
--- trunk/phase3/maintenance/dev/installphp.sh (rev 0)
+++ trunk/phase3/maintenance/dev/installphp.sh 2011-11-06 22:50:32 UTC (rev
102201)
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi
+DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
+
+set -e # DO NOT USE PIPES unless this is rewritten
+
+if [ -d $DEV/php ]; then
+ echo "PHP is already installed"
+ exit 1
+fi
+
+TAR=php5.4-latest.tar.gz
+PHPURL=http://snaps.php.net/$TAR
+
+cd $DEV
+
+# Some debain-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"
+if command -v wget &>/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 $IP/maintenance/dev/php/"
+./configure --prefix=$DEV/php/
+make
+make install
Property changes on: trunk/phase3/maintenance/dev/installphp.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/phase3/maintenance/dev/start.sh
===================================================================
--- trunk/phase3/maintenance/dev/start.sh (rev 0)
+++ trunk/phase3/maintenance/dev/start.sh 2011-11-06 22:50:32 UTC (rev
102201)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi
+DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
+
+PORT=4881
+
+echo "Starting up MediaWiki at http://localhost:$PORT/"
+echo ""
+
+cd $DEV/../../; # $IP
+$DEV/php/bin/php -S localhost:$PORT
Property changes on: trunk/phase3/maintenance/dev/start.sh
___________________________________________________________________
Added: svn:executable
+ *
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs