[evolvis-commits] r6534: Merged improvements from multi-mediawiki branch

Roland Mas lolando at debian.org
Wed Apr 14 14:24:28 CEST 2010


Author: Roland Mas <lolando at debian.org>
Date: 2010-04-14 14:24:28 +0200 (Wed, 14 Apr 2010)
New Revision: 6534

Added:
   trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/bin/mw-wrapper.php
Modified:
   trunk/gforge_base/evolvisforge/gforge/debian/changelog
   trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/cronjobs/create-wikis.sh
   trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/www/LocalSettings.php
Log:
Merged improvements from multi-mediawiki branch

Modified: trunk/gforge_base/evolvisforge/gforge/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/debian/changelog	2010-04-14 12:24:21 UTC (rev 6533)
+++ trunk/gforge_base/evolvisforge/gforge/debian/changelog	2010-04-14 12:24:28 UTC (rev 6534)
@@ -162,12 +162,12 @@
 
  -- Thorsten Glaser <t.glaser at tarent.de>  Mon, 15 Feb 2010 14:57:35 +0100
 
-gforge (4.8.2-1+1) unstable; urgency=low
+gforge (4.8.2-2) unstable; urgency=low
 
   * Updated Debconf template translations for German, French, Russian and
     Swedish (closes: #562704, #562929, #562940, #563350).
 
- -- Roland Mas <lolando at debian.org>  Thu, 07 Jan 2010 15:05:00 +0100
+ -- Roland Mas <lolando at debian.org>  Sun, 07 Feb 2010 22:27:19 +0100
 
 gforge (4.8.2-1) unstable; urgency=low
 

Added: trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/bin/mw-wrapper.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/bin/mw-wrapper.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/bin/mw-wrapper.php	2010-04-14 12:24:28 UTC (rev 6534)
@@ -0,0 +1,69 @@
+#! /usr/bin/php5 -f
+<?php
+/**
+ * FusionForge/Mediawiki integration
+ *
+ * Copyright 2010, Roland Mas
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ * 
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+if (count ($argv) < 3) {
+        echo "Usage: .../mw-wrapper.php <project> <script> [ arguments... ]
+For instance: .../mw-wrapper.php siteadmin importDump.php /tmp/wikidump.xml
+              .../mw-wrapper.php siteadmin rebuildrecentchanges.php
+" ;
+        exit (1) ;
+}
+
+$wrapperscript = array_shift ($argv) ;
+$fusionforgeproject = array_shift ($argv) ;
+$mwscript = array_shift ($argv) ;
+
+require (dirname(__FILE__)).'/../../../www/env.inc.php';
+require_once $gfwww.'include/pre.php';
+require_once $gfcommon.'include/cron_utils.php';
+
+// Plugins subsystem
+require_once $gfcommon.'include/Plugin.class.php' ;
+require_once $gfcommon.'include/PluginManager.class.php' ;
+
+setup_plugin_manager () ;
+
+$group = group_get_object_by_name($fusionforgeproject) ;
+if (!$group || $group->isError()) {
+	die ("Wrong group!\n") ;
+}
+
+if (!$group->usesPlugin('mediawiki')) {
+	die ("Project doesn't use the Mediawiki plugin\n") ;
+}
+
+
+define( "MEDIAWIKI", true );
+require_once $gfwww.'plugins/mediawiki/LocalSettings.php' ;
+
+$mwscript = MW_INSTALL_PATH.'/maintenance/'.$mwscript ;
+
+array_unshift ($argv, $mwscript, '--conf', "$wikidata/LocalSettings.php") ;
+
+ob_end_flush() ;
+
+require_once $mwscript ;
+
+?>

Modified: trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/cronjobs/create-wikis.sh
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/cronjobs/create-wikis.sh	2010-04-14 12:24:21 UTC (rev 6533)
+++ trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/cronjobs/create-wikis.sh	2010-04-14 12:24:28 UTC (rev 6534)
@@ -103,6 +103,14 @@
         exit 1
     fi
 
+    mwwrapper=/usr/share/gforge/plugins/mediawiki/bin/mw-wrapper.php
+    dumpfile=/etc/gforge/plugins/mediawiki/initial-content.xml
+
+    if [ -e $dumpfile ] ; then
+	$mwwrapper $project importDump.php $dumpfile
+	$mwwrapper $project rebuildrecentchanges.php
+    fi
+
 done
 
 rm -f $tmp3

Modified: trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/www/LocalSettings.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/www/LocalSettings.php	2010-04-14 12:24:21 UTC (rev 6533)
+++ trunk/gforge_base/evolvisforge/gforge/plugins/mediawiki/www/LocalSettings.php	2010-04-14 12:24:28 UTC (rev 6534)
@@ -1,6 +1,8 @@
 <?php
 
-$fusionforgeproject = 'siteadmin' ;
+if (!isset ($fusionforgeproject)) {
+	$fusionforgeproject = 'siteadmin' ;
+}
 $exppath = explode ('/', $_SERVER['PHP_SELF']) ;
 while (count ($exppath) >= 4) {
         if (($exppath[0] == 'plugins') && ($exppath[1] == 'mediawiki') && ($exppath[2] == 'wiki') && ($exppath[4] == 'index.php')) {




More information about the evolvis-commits mailing list