[Fusionforge-commits] r16137 - in branches: Branch_5_2/src/debian Branch_5_2/src/plugins/mediawiki/bin Branch_5_2/src/plugins/mediawiki/etc/cron.d wheezy/debian wheezy/plugins/mediawiki/bin wheezy/plugins/mediawiki/etc/cron.d

Thorsten Glaser mirabilos at fusionforge.org
Fri Aug 24 10:54:21 CEST 2012


Author: mirabilos
Date: 2012-08-24 10:54:21 +0200 (Fri, 24 Aug 2012)
New Revision: 16137

Modified:
   branches/Branch_5_2/src/debian/changelog
   branches/Branch_5_2/src/plugins/mediawiki/bin/mw-wrapper.php
   branches/Branch_5_2/src/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki
   branches/wheezy/debian/changelog
   branches/wheezy/plugins/mediawiki/bin/mw-wrapper.php
   branches/wheezy/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki
Log:
Unbreak and silence the MediaWiki nightly dump cronjob (Closes: #680165)

Modified: branches/Branch_5_2/src/debian/changelog
===================================================================
--- branches/Branch_5_2/src/debian/changelog	2012-08-24 08:43:47 UTC (rev 16136)
+++ branches/Branch_5_2/src/debian/changelog	2012-08-24 08:54:21 UTC (rev 16137)
@@ -15,8 +15,9 @@
   * Merge fusionforge (5.2~rc1wheezy1~exp1) experimental upload
   * Move wikis to new (as of 2010-03-19, possibly by accident) data path
   * Check image upload is enabled before trying to do so (Closes: #679521)
+  * Unbreak and silence the MediaWiki nightly dump cronjob (Closes: #680165)
 
- -- Thorsten Glaser <tg at mirbsd.de>  Fri, 24 Aug 2012 10:43:04 +0200
+ -- Thorsten Glaser <tg at mirbsd.de>  Fri, 24 Aug 2012 10:53:50 +0200
 
 fusionforge (5.2~rc1wheezy1~exp1) experimental; urgency=low
 

Modified: branches/Branch_5_2/src/plugins/mediawiki/bin/mw-wrapper.php
===================================================================
--- branches/Branch_5_2/src/plugins/mediawiki/bin/mw-wrapper.php	2012-08-24 08:43:47 UTC (rev 16136)
+++ branches/Branch_5_2/src/plugins/mediawiki/bin/mw-wrapper.php	2012-08-24 08:54:21 UTC (rev 16137)
@@ -27,16 +27,33 @@
  * Wrapper to call MediaWiki maintenance scripts on a forge project wiki.
  */
 
-if (count ($argv) < 3) {
-        echo "Usage: .../mw-wrapper.php <project> <script> [ arguments... ]
+function usage($rv=1) {
+        echo "Usage: .../mw-wrapper.php [-L] <project> <script> [ arguments... ]
 For instance: .../mw-wrapper.php siteadmin importDump.php /tmp/wikidump.xml
               .../mw-wrapper.php siteadmin rebuildrecentchanges.php
 " ;
-        exit (1) ;
+        exit($rv);
 }
 
+if (count($argv) < 3) {
+	usage();
+}
+
 $wrapperscript = array_shift ($argv) ;
 $fusionforgeproject = array_shift ($argv) ;
+if ($fusionforgeproject == "-L") {
+	if (count($argv) < 2) {
+		usage();
+	}
+	$fusionforgeproject = array_shift($argv);
+	$preload_localsettings = true;
+} else {
+	/*
+	 * saves some warnings
+	 * works if the mwscript includes e.g. commandLine.inc
+	 */
+	$preload_localsettings = false;
+}
 $mwscript = array_shift ($argv) ;
 
 require_once dirname(__FILE__).'/../../../common/include/env.inc.php';
@@ -66,14 +83,19 @@
 register_shutdown_function('ffmw_wrapper_fixup_searchpath',
     forge_get_config('database_user'));
 
-define( "MEDIAWIKI", true );
-require_once $gfwww.'plugins/mediawiki/LocalSettings.php' ;
+$ff_localsettings = forge_get_config('source_path') .
+    '/www/plugins/mediawiki/LocalSettings.php';
+if ($preload_localsettings) {
+	define("MEDIAWIKI", true);
+	require_once($ff_localsettings);
+}
 
 $src_path = forge_get_config('src_path', 'mediawiki');
 $mwscript = $src_path . '/maintenance/'.$mwscript ;
 
-array_unshift ($argv, $mwscript, '--conf', $fusionforge_basedir . '/plugins/mediawiki/www/LocalSettings.php') ;
+array_unshift($argv, $mwscript, '--conf', $ff_localsettings);
 
-while (@ob_end_flush());
+while (@ob_end_flush())
+	/* nothing */;
 
 require_once $mwscript ;

Modified: branches/Branch_5_2/src/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki
===================================================================
--- branches/Branch_5_2/src/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki	2012-08-24 08:43:47 UTC (rev 16136)
+++ branches/Branch_5_2/src/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki	2012-08-24 08:54:21 UTC (rev 16137)
@@ -17,4 +17,4 @@
 1,16,31,46 * * * * root [ -x $MWCRON/create-imagedirs.php ] && $PHP $MWCRON/create-imagedirs.php
 
 # Create wiki XML dumps every night
-55 1 * * * root [ -x $MWCRON/dump-wikis.php ] && $PHP $MWCRON/cronjobs/dump-wikis.php
+55 1 * * * root [ -x $MWCRON/dump-wikis.php ] && $PHP $MWCRON/dump-wikis.php

Modified: branches/wheezy/debian/changelog
===================================================================
--- branches/wheezy/debian/changelog	2012-08-24 08:43:47 UTC (rev 16136)
+++ branches/wheezy/debian/changelog	2012-08-24 08:54:21 UTC (rev 16137)
@@ -9,8 +9,9 @@
   * Update versioned Depends on MediaWiki
   * Move wikis to new (as of 2010-03-19, possibly by accident) data path
   * Check image upload is enabled before trying to do so (Closes: #679521)
+  * Unbreak and silence the MediaWiki nightly dump cronjob (Closes: #680165)
 
- -- Thorsten Glaser <tg at mirbsd.de>  Fri, 24 Aug 2012 10:41:57 +0200
+ -- Thorsten Glaser <tg at mirbsd.de>  Fri, 24 Aug 2012 10:53:50 +0200
 
 fusionforge (5.2~rc1-5) unstable; urgency=low
 

Modified: branches/wheezy/plugins/mediawiki/bin/mw-wrapper.php
===================================================================
--- branches/wheezy/plugins/mediawiki/bin/mw-wrapper.php	2012-08-24 08:43:47 UTC (rev 16136)
+++ branches/wheezy/plugins/mediawiki/bin/mw-wrapper.php	2012-08-24 08:54:21 UTC (rev 16137)
@@ -27,16 +27,33 @@
  * Wrapper to call MediaWiki maintenance scripts on a forge project wiki.
  */
 
-if (count ($argv) < 3) {
-        echo "Usage: .../mw-wrapper.php <project> <script> [ arguments... ]
+function usage($rv=1) {
+        echo "Usage: .../mw-wrapper.php [-L] <project> <script> [ arguments... ]
 For instance: .../mw-wrapper.php siteadmin importDump.php /tmp/wikidump.xml
               .../mw-wrapper.php siteadmin rebuildrecentchanges.php
 " ;
-        exit (1) ;
+        exit($rv);
 }
 
+if (count($argv) < 3) {
+	usage();
+}
+
 $wrapperscript = array_shift ($argv) ;
 $fusionforgeproject = array_shift ($argv) ;
+if ($fusionforgeproject == "-L") {
+	if (count($argv) < 2) {
+		usage();
+	}
+	$fusionforgeproject = array_shift($argv);
+	$preload_localsettings = true;
+} else {
+	/*
+	 * saves some warnings
+	 * works if the mwscript includes e.g. commandLine.inc
+	 */
+	$preload_localsettings = false;
+}
 $mwscript = array_shift ($argv) ;
 
 require_once dirname(__FILE__).'/../../../common/include/env.inc.php';
@@ -66,14 +83,19 @@
 register_shutdown_function('ffmw_wrapper_fixup_searchpath',
     forge_get_config('database_user'));
 
-define( "MEDIAWIKI", true );
-require_once $gfwww.'plugins/mediawiki/LocalSettings.php' ;
+$ff_localsettings = forge_get_config('source_path') .
+    '/www/plugins/mediawiki/LocalSettings.php';
+if ($preload_localsettings) {
+	define("MEDIAWIKI", true);
+	require_once($ff_localsettings);
+}
 
 $src_path = forge_get_config('src_path', 'mediawiki');
 $mwscript = $src_path . '/maintenance/'.$mwscript ;
 
-array_unshift ($argv, $mwscript, '--conf', $fusionforge_basedir . '/plugins/mediawiki/www/LocalSettings.php') ;
+array_unshift($argv, $mwscript, '--conf', $ff_localsettings);
 
-while (@ob_end_flush());
+while (@ob_end_flush())
+	/* nothing */;
 
 require_once $mwscript ;

Modified: branches/wheezy/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki
===================================================================
--- branches/wheezy/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki	2012-08-24 08:43:47 UTC (rev 16136)
+++ branches/wheezy/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki	2012-08-24 08:54:21 UTC (rev 16137)
@@ -17,4 +17,4 @@
 1,16,31,46 * * * * root [ -x $MWCRON/create-imagedirs.php ] && $PHP $MWCRON/create-imagedirs.php
 
 # Create wiki XML dumps every night
-55 1 * * * root [ -x $MWCRON/dump-wikis.php ] && $PHP $MWCRON/cronjobs/dump-wikis.php
+55 1 * * * root [ -x $MWCRON/dump-wikis.php ] && $PHP $MWCRON/dump-wikis.php




More information about the Fusionforge-commits mailing list