r59054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59053‎ | r59054 | r59055 >
Date:08:46, 14 November 2009
Author:siebrand
Status:deferred
Tags:
Comment:
--quiet is a standard option in the Translate commandline scripts, so updating help output and removing feature from r59025
Modified paths:
  • /trunk/extensions/Translate/scripts/createMessageIndex.php (modified) (history)
  • /trunk/extensions/Translate/utils/MessageIndexRebuilder.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/createMessageIndex.php
@@ -22,7 +22,7 @@
2323
2424 Options:
2525 --help Show this help text
26 - --progress Report on progress (default: false)
 26+ --quiet Only output errors
2727
2828 EOT
2929 );
@@ -33,8 +33,4 @@
3434 showUsage();
3535 }
3636
37 -if ( isset( $options['progress'] ) ) {
38 - MessageIndexRebuilder::execute();
39 -} else {
40 - MessageIndexRebuilder::execute( false );
41 -}
 37+MessageIndexRebuilder::execute();
\ No newline at end of file
Index: trunk/extensions/Translate/utils/MessageIndexRebuilder.php
@@ -13,15 +13,13 @@
1414 */
1515
1616 class MessageIndexRebuilder {
17 - public static function execute( $reportProgress = true ) {
 17+ public static function execute() {
1818 $groups = MessageGroups::singleton()->getGroups();
1919
2020 $hugearray = array();
2121 $postponed = array();
2222
23 - if( $reportProgress ) {
24 - STDOUT( "Working with ", 'main' );
25 - }
 23+ STDOUT( "Working with ", 'main' );
2624
2725 foreach ( $groups as $g ) {
2826 if ( !$g->exists() ) continue;
@@ -31,11 +29,11 @@
3230 continue;
3331 }
3432
35 - self::checkAndAdd( $hugearray, $g, false, $reportProgress );
 33+ self::checkAndAdd( $hugearray, $g );
3634 }
3735
3836 foreach ( $postponed as $g ) {
39 - self::checkAndAdd( $hugearray, $g, true, $reportProgress );
 37+ self::checkAndAdd( $hugearray, $g, true );
4038 }
4139
4240 global $wgCacheDirectory;
@@ -45,7 +43,7 @@
4644 $writer->close();
4745 }
4846
49 - protected static function checkAndAdd( &$hugearray, $g, $ignore = false, $reportProgress = true ) {
 47+ protected static function checkAndAdd( &$hugearray, $g, $ignore = false ) {
5048 if ( $g instanceof MessageGroupBase ) {
5149 $cache = new MessageGroupCache( $g );
5250 if ( $cache->exists() ) {
@@ -61,9 +59,7 @@
6260
6361 $id = $g->getId();
6462
65 - if( $reportProgress ) {
66 - STDOUT( "$id ", 'main' );
67 - }
 63+ STDOUT( "$id ", 'main' );
6864
6965 $namespace = $g->getNamespace();
7066

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59025Allow suppression of progress reportsiebrand21:05, 13 November 2009

Status & tagging log