Index: trunk/extensions/uniwiki/.uniwiki.settings |
— | — | @@ -1,15 +0,0 @@ |
2 | | - |
3 | | -# uniwiki |
4 | | -# ======= |
5 | | -\$wgLogo = \"\$wgScriptPath/extensions/uniwiki/uniwiki.png\"; |
6 | | -\$uw = \"\$IP/extensions/uniwiki\"; |
7 | | -require_once(\"\$uw/CssHooks/CssHooks.php\"); |
8 | | -require_once(\"\$uw/Javascript/Javascript.php\"); |
9 | | -require_once(\"\$uw/MooTools12core/MooTools12core.php\"); |
10 | | -require_once(\"\$uw/AutoCreateCategoryPages/AutoCreateCategoryPages.php\"); |
11 | | -require_once(\"\$uw/GenericEditPage/GenericEditPage.php\"); |
12 | | -require_once(\"\$uw/CatBoxAtTop/CatBoxAtTop.php\"); |
13 | | -require_once(\"\$uw/Layouts/Layouts.php\"); |
14 | | -require_once(\"\$uw/Authors/Authors.php\"); |
15 | | -require_once(\"\$uw/CustomToolbar/CustomToolbar.php\"); |
16 | | -require_once(\"\$uw/CreatePage/CreatePage.php\"); |
Index: trunk/extensions/uniwiki/.make-uniwiki-settings |
— | — | @@ -0,0 +1,2 @@ |
| 2 | +# UNIWIKI settings |
| 3 | +require_once(\"\$IP/extensions/uniwiki/UniwikiSettings.php\"); |
Index: trunk/extensions/uniwiki/make-uniwiki |
— | — | @@ -0,0 +1,92 @@ |
| 2 | +#!/bin/bash |
| 3 | +# |
| 4 | +# This script is meant to be ran from the directory where you want to |
| 5 | +# install the wiki, for example in /var/www/. You will most likely have |
| 6 | +# to run the scirpt with administrator privileges as it requires, among |
| 7 | +# other things, writing to system files and restarting apache. It will: |
| 8 | +# 1) wget the MediaWiki source |
| 9 | +# 2) extract the source to the provided directory |
| 10 | +# 3) check out the UNIWIKI extensions to the extensions directory |
| 11 | +# of the MediaWiki installation |
| 12 | +# 4) patch the installer script to add the default UNIWIKI settings |
| 13 | +# to the LocalSettings.php file upon installation |
| 14 | +# 5) add a virtual host entry to the sites-available and sites-enabled |
| 15 | +# directories (Debian) or httpd.conf file |
| 16 | +# 6) reload the apache webserver |
| 17 | +# NOTE: This script assumes that you already have the DNS entry set up |
| 18 | +# for the wiki you are installing. Also, it assumes that you have |
| 19 | +# Subversion client installed and in your path. |
| 20 | + |
| 21 | +# print usage message if not called with correct args |
| 22 | +if [ $# -eq 0 ]; then |
| 23 | + echo "Usage: $0 <wiki-name>" |
| 24 | + exit |
| 25 | +fi |
| 26 | + |
| 27 | +# info for this installation |
| 28 | +INSTALL_DIRNAME=$1 |
| 29 | +INSTALL_PATH=`pwd` |
| 30 | + |
| 31 | +# mediawiki settingsi |
| 32 | +MEDIAWIKI_SRC_URL="http://download.wikimedia.org/mediawiki/1.13/mediawiki-1.13.1.tar.gz" |
| 33 | +MEDIAWIKI_TARGZ="mediawiki-1.13.0.tar.gz" |
| 34 | +MEDIAWIKI_DIRNAME="mediawiki-1.13.0" |
| 35 | +MEDIAWIKI_LINENUM=1729 |
| 36 | + |
| 37 | +# uniwiki settings |
| 38 | +UNIWIKI_SRC_URL="http://svn.mepemepe.com/uniwiki/trunk" |
| 39 | +UNIWIKI_DIRNAME="uniwiki" |
| 40 | +UNIWIKI_SETTINGS_FILE="$INSTALL_PATH/$INSTALL_DIRNAME/extensions/$UNIWIKI_DIRNAME/.make-uniwiki-settings" |
| 41 | + |
| 42 | +# apache settings |
| 43 | +VHOST_ENTRY="\n\n |
| 44 | +# This virtual host entry was automagically added\n |
| 45 | +# by $USER using the 'make-uniwiki' script.\n |
| 46 | +<VirtualHost *:80>\n |
| 47 | + \tServerName $INSTALL_DIRNAME\n |
| 48 | + \tDocumentRoot $INSTALL_PATH/$INSTALL_DIRNAME\n |
| 49 | + \tOptions FollowSymLinks MultiViews\n |
| 50 | + \t<Directory $INSTALL_PATH/$INSTALL_DIRNAME>\n |
| 51 | + \t\tOptions FollowSymLinks Indexes\n |
| 52 | + \t\tAllowOverride all\n |
| 53 | + \t\tOrder allow,deny\n |
| 54 | + \t\tallow from all\n |
| 55 | + \t</Directory>\n |
| 56 | +</VirtualHost>\n |
| 57 | +" |
| 58 | + |
| 59 | +# get the MediaWiki src, extract it, and name it accordingly |
| 60 | +wget $MEDIAWIKI_SRC_URL |
| 61 | +tar -xzf $MEDIAWIKI_TARGZ |
| 62 | +rm $MEDIAWIKI_TARGZ |
| 63 | +mv $MEDIAWIKI_DIRNAME $INSTALL_DIRNAME |
| 64 | + |
| 65 | +# move to the extensions directory and get the UNIWIKI extensions |
| 66 | +cd "$INSTALL_PATH/$INSTALL_DIRNAME/extensions" |
| 67 | +svn co $UNIWIKI_SRC_URL $UNIWIKI_DIRNAME |
| 68 | + |
| 69 | +# patch the MediaWiki install script to add the UNIWIKI default settings |
| 70 | +cd "$INSTALL_PATH/$INSTALL_DIRNAME/config" |
| 71 | +split -l $MEDIAWIKI_LINENUM -a 1 index.php temp |
| 72 | +cat tempa $UNIWIKI_SETTINGS_FILE tempb > index.php |
| 73 | +rm tempa tempb |
| 74 | + |
| 75 | +# add the virtual host entry and reload the server |
| 76 | +if [[ -d /etc/apache2/sites-available ]]; then |
| 77 | + APACHE_CONF_FILE="/etc/apache2/sites-available/$INSTALL_DIRNAME" |
| 78 | + echo -e $VHOST_ENTRY > "/etc/apache2/sites-available/$INSTALL_DIRNAME" |
| 79 | + a2ensite $INSTALL_DIRNAME |
| 80 | + /etc/init.d/apache2 reload |
| 81 | +elif [[ -f /etc/httpd/conf/httpd.conf ]]; then |
| 82 | + echo -e $VHOST_ENTRY >> /etc/httpd/conf/httpd.conf |
| 83 | + /etc/rc.d/httpd reload |
| 84 | +else |
| 85 | + exit |
| 86 | +fi |
| 87 | + |
| 88 | +# set the permissions to www-data |
| 89 | +# (and group write, so devs can edit it) |
| 90 | +chown -R www-data:www-data "$INSTALL_PATH/$INSTALL_DIRNAME" |
| 91 | +chmod -R g+w "$INSTALL_PATH/$INSTALL_DIRNAME" |
| 92 | + |
| 93 | +exit |
Property changes on: trunk/extensions/uniwiki/make-uniwiki |
___________________________________________________________________ |
Added: svn:executable |
1 | 94 | + * |
Index: trunk/extensions/uniwiki/CustomToolbar/CustomToolbar.php |
— | — | @@ -104,14 +104,14 @@ |
105 | 105 | $form = new CustomToolbarUploadForm($wgRequest); |
106 | 106 | $form->execute(); |
107 | 107 | } |
108 | | - |
109 | 108 | $wgHooks['UploadComplete'][] = array('CustomToolbarUploadForm::showSuccess'); |
110 | 109 | //XX TODO investigate FileUpload hook for attachment purposes |
111 | 110 | //$wgHooks['FileUpload'][] = array('CustomToolbarUploadForm::showSuccess', 'attachment'); |
112 | | -if ($wgVersion == '1.13.0') { |
| 111 | +$wgSpecialRefactorVersion = '1.13.0'; |
| 112 | +if (version_compare($wgVersion, $wgSpecialRefactorVersion, '<')) { |
| 113 | + require_once('includes/SpecialUpload.php'); |
| 114 | +} else { |
113 | 115 | require_once('includes/specials/SpecialUpload.php'); |
114 | | -} else { |
115 | | - require_once('includes/SpecialUpload.php'); |
116 | 116 | } |
117 | 117 | class CustomToolbarUploadForm extends UploadForm { |
118 | 118 | /* Some code poached from Travis Derouin's <travis@wikihow.com> |