r35924 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35923‎ | r35924 | r35925 >
Date:13:05, 5 June 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
+ parameter -b to select storage backend (so installation of stores is possible while the wiki still runs on
another storage engine, useful for upgrades to new stores on running systems)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php
@@ -12,6 +12,8 @@
1313 * -d <delay> Wait for this many milliseconds after processing an article, useful for limiting server load.
1414 * -s <startid> Start refreshing at given article ID, useful for partial refreshing
1515 * -e <endid> Stop refreshing at given article ID, useful for partial refreshing
 16+ * -b <backend> Execute the operation for the storage backend of the given name
 17+ * (default is to use the current backend)
1618 * -v Be verbose about the progress.
1719 * -c Will refresh only category pages (and other explicitly named namespaces)
1820 * -p Will refresh only property pages (and other explicitly named namespaces)
@@ -23,7 +25,7 @@
2426 * @author Markus Krötzsch
2527 */
2628
27 -$optionsWithArgs = array( 'd', 's', 'e' ); // -d <delay>, -s <startid>
 29+$optionsWithArgs = array( 'd', 's', 'e', 'b' ); // -d <delay>, -s <startid>, -e <endid>, -b <backend>
2830
2931 $mwPath = getenv('MW_INSTALL_PATH') !== false ? getenv('MW_INSTALL_PATH').'/maintenance/' : '';
3032 require_once("{$mwPath}counter.php");
@@ -50,6 +52,12 @@
5153 $end = min(intval($options['e']), $end);
5254 }
5355
 56+if ( array_key_exists( 'b', $options ) ) {
 57+ global $smwgDefaultStore;
 58+ $smwgDefaultStore = $options['b'];
 59+ print "\nSelected storage $smwgDefaultStore for update!\n\n";
 60+}
 61+
5462 if ( array_key_exists( 'v', $options ) ) {
5563 $verbose = true;
5664 } else {
Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php
@@ -26,7 +26,7 @@
2727 * so allow override
2828 */
2929
30 -$optionsWithArgs = array('user', 'password');
 30+$optionsWithArgs = array('user', 'password','b');
3131 require_once ( getenv('MW_INSTALL_PATH') !== false
3232 ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
3333 : 'commandLine.inc' );
@@ -40,11 +40,17 @@
4141 $wgDBpassword = $options['password'];
4242 }
4343
 44+if ( array_key_exists( 'b', $options ) ) {
 45+ global $smwgDefaultStore;
 46+ $smwgDefaultStore = $options['b'];
 47+ print "\nSelected storage $smwgDefaultStore for update!\n\n";
 48+}
4449
 50+
4551 global $smwgIP;
4652 if (! isset($smwgIP))
4753 $smwgIP = dirname(__FILE__) . '/..';
48 -
 54+
4955 require_once($smwgIP . '/includes/SMW_GlobalFunctions.php');
5056
5157 smwfGetStore()->setup();

Status & tagging log