[Fusionforge-commits] r9604 - in trunk/gforge: packaging/dirs packaging/install plugins/mediawiki plugins/mediawiki/bin plugins/mediawiki/etc/plugins/mediawiki plugins/mediawiki/www

Olaf Lenz olenz at libremir.placard.fr.eu.org
Mon Apr 26 14:49:46 CEST 2010


Author: olenz
Date: 2010-04-26 14:49:45 +0200 (Mon, 26 Apr 2010)
New Revision: 9604

Removed:
   trunk/gforge/plugins/mediawiki/etc/plugins/mediawiki/config.php
Modified:
   trunk/gforge/packaging/dirs/plugin-mediawiki
   trunk/gforge/packaging/install/plugin-mediawiki
   trunk/gforge/plugins/mediawiki/README
   trunk/gforge/plugins/mediawiki/bin/mw-wrapper.php
   trunk/gforge/plugins/mediawiki/www/LocalSettings.php
Log:
mediawiki-plugin: rewrote README, worked a bit on packaging (not tested, though!).

Modified: trunk/gforge/packaging/dirs/plugin-mediawiki
===================================================================
--- trunk/gforge/packaging/dirs/plugin-mediawiki	2010-04-26 11:29:54 UTC (rev 9603)
+++ trunk/gforge/packaging/dirs/plugin-mediawiki	2010-04-26 12:49:45 UTC (rev 9604)
@@ -4,6 +4,8 @@
 usr/share/gforge/plugins/mediawiki/common
 usr/share/gforge/plugins/mediawiki/cronjobs
 usr/share/gforge/etc/httpd.d
+usr/share/gforge/etc/cron.d
 usr/share/mediawiki/skins
 usr/share/mediawiki/skins/fusionforge
-var/lib/gforge/plugins/mediawiki/wikidata
+var/lib/gforge/plugins/mediawiki/projects
+var/lib/gforge/plugins/mediawiki/master

Modified: trunk/gforge/packaging/install/plugin-mediawiki
===================================================================
--- trunk/gforge/packaging/install/plugin-mediawiki	2010-04-26 11:29:54 UTC (rev 9603)
+++ trunk/gforge/packaging/install/plugin-mediawiki	2010-04-26 12:49:45 UTC (rev 9604)
@@ -1,3 +1,4 @@
+plugins/mediawiki/*            usr/share/gforge/plugins/mediawiki/
 plugins/mediawiki/bin/*            usr/share/gforge/plugins/mediawiki/bin/
 plugins/mediawiki/common/*         usr/share/gforge/plugins/mediawiki/common/
 plugins/mediawiki/cronjobs/*       usr/share/gforge/plugins/mediawiki/cronjobs/
@@ -2,3 +3,5 @@
 plugins/mediawiki/www/*            usr/share/gforge/plugins/mediawiki/www/
-plugins/mediawiki/mediawiki-skin/* usr/share/mediawiki/skins/
+plugins/mediawiki/mediawiki-skin/* usr/share/gforge/plugins/mediawiki/mediawiki-skin/
+plugins/mediawiki/etc/*    usr/share/gforge/etc/
 plugins/mediawiki/etc/httpd.d/*    usr/share/gforge/etc/httpd.d/
+plugins/mediawiki/etc/cron.d/*    usr/share/gforge/etc/cron.d/

Modified: trunk/gforge/plugins/mediawiki/README
===================================================================
--- trunk/gforge/plugins/mediawiki/README	2010-04-26 11:29:54 UTC (rev 9603)
+++ trunk/gforge/plugins/mediawiki/README	2010-04-26 12:49:45 UTC (rev 9604)
@@ -1,56 +1,87 @@
-# This plugin was made with the help of these documents
-# http://bugzilla.wikipedia.org/show_bug.cgi?id=814
-# http://meta.wikimedia.org/wiki/User:Otheus/Auto_Login_via_REMOTE_USER
-# Thanks to their authors
-#
-# You will find LDAP authentication plugin 
-# usr/share/mediawiki/LocalLdapSettings.php
-# usr/share/mediawiki/includes/LdapAuthentication.php
-# which were usefull examples but are of no used
-#
-# The plugin is based on the idea to add a Gforge skin to Mediawiki
-# and to use Gforge authentication mecanism to replace mediawiki one
-# That's why it is inspired by LDAP and Autologin examples
-#
-# The skin is in :
-# usr/share/mediawiki/skins/FusionForge.php file 
-# and 
-# usr/share/mediawiki/skins/fusionforge/ dir
-# It is based on monobook skin and all css changes are only in main.css
-#
-# usr/share/gforge/etc/httpd.d/03mediawiki contains the apache part you need to add to have this work
-# This is automagically used in debian package or if you use 'setup' script
-#
-# INSTALL -- INSTALL
-#
-# To install you have to first install mediawiki and modify LocalSettings.php
-# You can install source code mediawiki in /usr/share/mediawiki
-# And, you can move /usr/share/gforge/plugins/mediawiki/www/LocalSettings.php into /usr/share/mediawiki/LocalSettings.php
-# By default, plugin used postgres database. You can choose to use mysql or postgresql database.
-# In case you use postgresql you can either choose the same or a separate db
-# the same or different database users.
-#
-# For skins, you can move  /usr/share/gforge/plugins/mediawiki/mediawiki-skin/fusionforge into /usr/share/mediawiki/skins/
-# and /usr/share/gforge/plugins/mediawiki/mediawiki-skin/FusionForge.php into /usr/share/mediawiki/skins/
-#
-# You must copy /usr/share/gforge/plugins/mediawiki/etc/httpd.d/03mediawiki into /etc/gforge/httpd.d/03mediawiki
-# You can link : ln -s /usr/share/mediawiki /usr/share/gforge/www/plugins/mediawiki/
-#
-# This is mostly the only thing you have to do to activate FusionForge mediawiki plugin
-# and tell mediawiki you want to use gforge skin
-# disable the other skins is recommended
-# 
-# BACKPORT fusionforge 4.8 --
-#
-# If you use fusionforge4.8, you may be add this at the end in file /usr/share/mediawiki/LocalSettings.php
-# if( defined( 'MW_INSTALL_PATH' ) ) {
-#		$IP = MW_INSTALL_PATH;
-# } else {
-#		$IP = dirname( __FILE__ );
-# }
-# Because in 4.8, fusionforge et mediawiki use the same variable $IP, but they aren't the same value.
-# And may be you can add this in /etc/gforge/httpd.d/06maindirhttp
-# AliasMatch ^/plugins/mediawiki/wiki/[-a-zA-Z0-9_]*/index.php /usr/share/gforge/www/plugins/mediawiki/index.php
-# AliasMatch ^/plugins/mediawiki/wiki/([-a-zA-Z0-9_]*)/images/(.*) /var/lib/gforge/plugins/mediawiki/wikidata/$1/images/$2
-# AliasMatch ^/plugins/mediawiki/wiki/([-a-zA-Z0-9_]*)/skins/(.*) /usr/share/mediawiki/skins/$2
-#
+FUSIONFORGE MEDIAWIKI PLUGIN README
+-----------------------------------
+Olaf Lenz, 2010
+
+The plugin adds support for Mediawiki to FusionForge. When the plugin
+is activated for a project, a Mediawiki instance for the project is
+created, that can be edited by project members.
+
+This file describes how to INSTALL and CUSTOMIZE the plugin, and what
+to do when the Mediawiki instalation is UPGRADEd.
+
+Installation
+------------
+
+If you have installed FusionForge and the plugin via a packaging
+system (RPM or DEB), the plugin should be ready to run and only needs
+to be enabled in the plugin manager.
+If you have manually installed FusionForge, you need to do the
+following to get it working:
+
+1. Download the Mediawiki sources from 
+      http://www.mediawiki.org/wiki/MediaWiki
+   or install Mediawiki via a package manager.
+
+2. Unpack the sources into a directory that is accessible to
+   FusionForge.
+
+3. Put the path to Mediawiki's source directory into the configuration
+   variable "[mediawiki]source_path" by adding the following lines into
+   your FusionForge configuration file (/etc/fusionforge/config.ini):
+
+[mediawiki]
+src_path = < Mediawiki source path >
+
+4. Run
+
+> php bin/mw-plugin-init.php
+
+  This will create a number of symbolic links in the FusionForge var
+  directory (/var/lib/fusionforge) required by the plugin. The command
+  has to be run by a user that can write to the FusionForge var
+  directory.
+
+5. Adapt and add the contents of the file etc/httpd.d/03mediawiki to
+   your apache configuration. To do that, the script "setup" might be
+   helpful. Furthermore, adapt and add the following lines to the
+   apache configuration:
+
+RedirectMatch 301 ^({sys_urlprefix}plugins/mediawiki/wiki/[-a-zA-Z0-9_]*)/*$ $1/index.php
+        AliasMatch ^{sys_urlprefix}plugins/mediawiki/wiki/[-a-zA-Z0-9_]*/index.php {usr_share_gforge}/www/plugins/mediawiki/index.php
+        AliasMatch ^{sys_urlprefix}plugins/mediawiki/wiki/([-a-zA-Z0-9_]*)/images/(.*) {var_lib_gforge}/plugins/mediawiki/projects/$1/images/$2
+
+6. Add the cronjob in etc/cron.d/mediawiki to the FusionForge
+   crontab. To do that, the script "setup" might be helpful.
+
+Customizing the plugin
+----------------------
+
+The Mediawiki plugin knows all configuration variables described in
+etc/config.ini. To customize Mediawiki (e.g. enable uploads), change
+the value of any of the variables in the file
+/etc/fusionforge/config.ini.
+
+Furthermore, you can customize all Mediawiki instances within
+FusionForge by creating and/or modifying the file
+  /etc/fusionforge/plugins/mediawiki/LocalSettings.php 
+In this file, you can add extensions or change anything that can be
+done in Mediawiki's LocalSettings.php.
+
+To customize the settings of a specific project, you can additionally
+create a file 
+  /var/lib/fusionforge/plugin/mediawiki/projects/<project>/ProjectSettings.php
+with additional customizations.
+
+
+Upgrading the Mediawiki installation
+------------------------------------
+
+(TODO: not working!)
+When FusionForge was installed from a package manager, this should be
+happening automatically. Otherwise, when the Mediawiki installation is
+upgraded, it is necessary to upgrade all project instances. To do
+that, you can call
+
+	bin/mw-wrapper <project> update.php
+
+

Modified: trunk/gforge/plugins/mediawiki/bin/mw-wrapper.php
===================================================================
--- trunk/gforge/plugins/mediawiki/bin/mw-wrapper.php	2010-04-26 11:29:54 UTC (rev 9603)
+++ trunk/gforge/plugins/mediawiki/bin/mw-wrapper.php	2010-04-26 12:49:45 UTC (rev 9604)
@@ -35,13 +35,13 @@
 $fusionforgeproject = array_shift ($argv) ;
 $mwscript = array_shift ($argv) ;
 
-include (dirname(__FILE__)).'/../../env.inc.php';
-include $gfwww.'include/pre.php';
-include $gfcommon.'include/cron_utils.php';
+include (dirname(__FILE__).'/../../env.inc.php');
+include ($gfwww.'include/pre.php');
+include ($gfcommon.'include/cron_utils.php');
 
 // Plugins subsystem
-include $gfcommon.'include/Plugin.class.php' ;
-include $gfcommon.'include/PluginManager.class.php' ;
+require_once($gfcommon.'include/Plugin.class.php');
+require_once($gfcommon.'include/PluginManager.class.php');
 
 setup_plugin_manager () ;
 
@@ -58,9 +58,10 @@
 define( "MEDIAWIKI", true );
 require_once $gfwww.'plugins/mediawiki/LocalSettings.php' ;
 
-$mwscript = MW_INSTALL_PATH.'/maintenance/'.$mwscript ;
+$src_path = forge_get_config('src_path', 'mediawiki');
+$mwscript = $src_path . '/maintenance/'.$mwscript ;
 
-array_unshift ($argv, $mwscript, '--conf', "$wikidata/LocalSettings.php") ;
+array_unshift ($argv, $mwscript, '--conf', $gfplugins . 'mediawiki/www/LocalSettings.php') ;
 
 ob_end_flush() ;
 

Deleted: trunk/gforge/plugins/mediawiki/etc/plugins/mediawiki/config.php
===================================================================
--- trunk/gforge/plugins/mediawiki/etc/plugins/mediawiki/config.php	2010-04-26 11:29:54 UTC (rev 9603)
+++ trunk/gforge/plugins/mediawiki/etc/plugins/mediawiki/config.php	2010-04-26 12:49:45 UTC (rev 9604)
@@ -1,10 +0,0 @@
-<?php
-
-// If you change the following, don't forget to adapt httpd.d 
-// accordingly
-# $mediawiki_var_path = "$sys_var_path/plugins/mediawiki";
-# $mediawiki_src_path = "/usr/share/mediawiki";
-# $mediawiki_projects_path = "$mediawiki_var_path/projects"
-# $mediawiki_master_path = "$mediawiki_var_path/master"
-
-?>
\ No newline at end of file

Modified: trunk/gforge/plugins/mediawiki/www/LocalSettings.php
===================================================================
--- trunk/gforge/plugins/mediawiki/www/LocalSettings.php	2010-04-26 11:29:54 UTC (rev 9603)
+++ trunk/gforge/plugins/mediawiki/www/LocalSettings.php	2010-04-26 12:49:45 UTC (rev 9604)
@@ -32,7 +32,6 @@
 } else {
 	// when run from the command line
         include $gfconfig . 'database.inc';
-	include $gfcommon .'include/config.php';
 }
 
 include $gfplugins . 'mediawiki/common/config-vars.php';




More information about the Fusionforge-commits mailing list