Index: trunk/phase3/maintenance/dev/install.sh |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | #!/bin/bash |
3 | 3 | |
4 | | -if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi |
| 4 | +if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi |
5 | 5 | DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) |
6 | 6 | |
7 | 7 | "$DEV/installphp.sh" |
Index: trunk/phase3/maintenance/dev/installmw.sh |
— | — | @@ -1,16 +1,25 @@ |
2 | 2 | #!/bin/bash |
3 | 3 | |
4 | | -if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi |
| 4 | +if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi |
5 | 5 | DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) |
6 | 6 | |
| 7 | +if [ -d "$DEV/php" -a -x "$DEV/php/bin/php" ]; then |
| 8 | + PHP="$DEV/php/bin/php" |
| 9 | +elif [ -d "$HOME/.mwphp" -a -x "$HOME/.mwphp/bin/php" ]; then |
| 10 | + PHP="$HOME/.mwphp/bin/php" |
| 11 | +else |
| 12 | + echo "Local copy of PHP is not installed" |
| 13 | + echo 1 |
| 14 | +fi |
| 15 | + |
7 | 16 | set -e |
8 | 17 | |
9 | 18 | PORT=4881 |
10 | 19 | |
11 | 20 | cd "$DEV/../../"; # $IP |
12 | 21 | |
13 | | -mkdir "$DEV/data" |
14 | | -"$DEV/php/bin/php" maintenance/install.php --server="http://localhost:$PORT" --scriptpath="" --dbtype=sqlite --dbpath="$DEV/data" --pass=admin "Trunk Test" "$USER" |
| 22 | +mkdir -p "$DEV/data" |
| 23 | +"$PHP" maintenance/install.php --server="http://localhost:$PORT" --scriptpath="" --dbtype=sqlite --dbpath="$DEV/data" --pass=admin "Trunk Test" "$USER" |
15 | 24 | echo "" |
16 | 25 | echo "Development wiki created with admin user $USER and password 'admin'." |
17 | 26 | echo "" |
Index: trunk/phase3/maintenance/dev/start.sh |
— | — | @@ -1,12 +1,21 @@ |
2 | 2 | #!/bin/bash |
3 | 3 | |
4 | | -if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi |
| 4 | +if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi |
5 | 5 | DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) |
6 | 6 | |
| 7 | +if [ -d "$DEV/php" -a -x "$DEV/php/bin/php" ]; then |
| 8 | + PHP="$DEV/php/bin/php" |
| 9 | +elif [ -d "$HOME/.mwphp" -a -x "$HOME/.mwphp/bin/php" ]; then |
| 10 | + PHP="$HOME/.mwphp/bin/php" |
| 11 | +else |
| 12 | + echo "Local copy of PHP is not installed" |
| 13 | + echo 1 |
| 14 | +fi |
| 15 | + |
7 | 16 | PORT=4881 |
8 | 17 | |
9 | 18 | echo "Starting up MediaWiki at http://localhost:$PORT/" |
10 | 19 | echo "" |
11 | 20 | |
12 | 21 | cd "$DEV/../../"; # $IP |
13 | | -"$DEV/php/bin/php" -S "localhost:$PORT" |
| 22 | +"$PHP" -S "localhost:$PORT" |
Index: trunk/phase3/maintenance/dev/installphp.sh |
— | — | @@ -1,13 +1,13 @@ |
2 | 2 | #!/bin/bash |
3 | 3 | |
4 | | -if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi |
| 4 | +if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi |
5 | 5 | DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) |
6 | 6 | |
7 | 7 | set -e # DO NOT USE PIPES unless this is rewritten |
8 | 8 | |
9 | | -if [ -d "$DEV/php" ]; then |
| 9 | +if [ -d "$DEV/php" -a -x "$DEV/php/bin/php" ] || [ -d "$HOME/.mwphp" -a -x "$HOME/.mwphp/bin/php" ]; then |
10 | 10 | echo "PHP is already installed" |
11 | | - exit 1 |
| 11 | + exit 0 |
12 | 12 | fi |
13 | 13 | |
14 | 14 | TAR=php5.4-latest.tar.gz |
— | — | @@ -15,6 +15,20 @@ |
16 | 16 | |
17 | 17 | cd "$DEV" |
18 | 18 | |
| 19 | +echo "Preparing to download and install a local copy of PHP 5.4, note that this can take some time to do." |
| 20 | +echo "If you wish to avoid re-doing this for uture dev installations of MediaWiki we suggest installing php in ~/.mwphp" |
| 21 | +echo -n "Install PHP in ~/.mwphp [y/N]: " |
| 22 | +read INSTALLINHOME |
| 23 | + |
| 24 | +case "$INSTALLINHOME" in |
| 25 | + [Yy] | [Yy][Ee][Ss] ) |
| 26 | + PREFIX="$HOME/.mwphp" |
| 27 | + ;; |
| 28 | + *) |
| 29 | + PREFIX="$DEV/php/" |
| 30 | + ;; |
| 31 | +esac |
| 32 | + |
19 | 33 | # Some debain-like systems bundle wget but not curl, some other systems |
20 | 34 | # like os x bundle curl but not wget... use whatever is available |
21 | 35 | echo -n "Downloading PHP 5.4" |
— | — | @@ -35,7 +49,7 @@ |
36 | 50 | |
37 | 51 | cd php5.4-*/ |
38 | 52 | |
39 | | -echo "Configuring and installing php 5.4 in \$IP/maintenance/dev/php/" |
40 | | -./configure --prefix="$DEV/php/" |
| 53 | +echo "Configuring and installing php 5.4 in $PREFIX" |
| 54 | +./configure --prefix="$PREFIX" |
41 | 55 | make |
42 | 56 | make install |