[Fusionforge-commits] r9328 - trunk/gforge/plugins/mediawiki/bin

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Apr 2 14:52:47 CEST 2010


Author: lolando
Date: 2010-04-02 14:52:47 +0200 (Fri, 02 Apr 2010)
New Revision: 9328

Added:
   trunk/gforge/plugins/mediawiki/bin/mw-wrapper.php
Removed:
   trunk/gforge/plugins/mediawiki/bin/import-wiki.php
Log:
Turned the script into a more generic wrapper for MW's maintenance scripts

Deleted: trunk/gforge/plugins/mediawiki/bin/import-wiki.php
===================================================================
--- trunk/gforge/plugins/mediawiki/bin/import-wiki.php	2010-04-02 12:52:37 UTC (rev 9327)
+++ trunk/gforge/plugins/mediawiki/bin/import-wiki.php	2010-04-02 12:52:47 UTC (rev 9328)
@@ -1,63 +0,0 @@
-#! /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
- */
-
-$script = array_shift ($argv) ;
-$fusionforgeproject = array_shift ($argv) ;
-array_unshift ($argv, $script) ;
-
-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' ;
-
-// SCM-specific plugins subsystem
-require_once $gfcommon.'include/SCMPlugin.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") ;
-}
-
-ob_end_flush() ;
-
-define( "MEDIAWIKI", true );
-require_once $gfwww.'plugins/mediawiki/LocalSettings.php' ;
-chdir ($wikidata) ;
-$script = array_shift ($argv) ;
-array_unshift ($argv, '--conf', "$wikidata/LocalSettings.php") ;
-array_unshift ($argv, $script) ;
-
-require_once '/usr/share/mediawiki/maintenance/importDump.php' ;
-
-?>

Copied: trunk/gforge/plugins/mediawiki/bin/mw-wrapper.php (from rev 9327, trunk/gforge/plugins/mediawiki/bin/import-wiki.php)
===================================================================
--- trunk/gforge/plugins/mediawiki/bin/mw-wrapper.php	                        (rev 0)
+++ trunk/gforge/plugins/mediawiki/bin/mw-wrapper.php	2010-04-02 12:52:47 UTC (rev 9328)
@@ -0,0 +1,68 @@
+#! /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
+ */
+
+  /* Usage: .../mw-wrapper.php <project> <script> [ arguments... ]
+   * for instance: .../mw-wrapper.php siteadmin importDump.php /tmp/wikidump.xml
+   */
+
+$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' ;
+
+// SCM-specific plugins subsystem
+require_once $gfcommon.'include/SCMPlugin.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 ;
+
+?>




More information about the Fusionforge-commits mailing list