r86177 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86176‎ | r86177 | r86178 >
Date:03:09, 16 April 2011
Author:demon
Status:ok
Tags:
Comment:
Kill file-scope define
Modified paths:
  • /trunk/extensions/DumpHTML/dumpHTML.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/DumpHTML/dumpHTML.inc
@@ -3,10 +3,11 @@
44 * @file
55 * @ingroup Maintenance
66 */
 7+class DumpHTML {
78
8 -define( 'REPORTING_INTERVAL', 10 );
 9+ # How often to report something to the user
 10+ const REPORTING_INTERVAL = 10;
911
10 -class DumpHTML {
1112 # Destination directory
1213 var $dest;
1314
@@ -193,11 +194,11 @@
194195
195196 for ( $id = $start, $i = 0; $id <= $end; $id += $this->sliceDenominator, $i++ ) {
196197 wfWaitForSlaves( 20 );
197 - if ( !( $i % REPORTING_INTERVAL) ) {
 198+ if ( !( $i % self::REPORTING_INTERVAL) ) {
198199 print "Processing ID: $id\r";
199200 $this->setCheckpoint( 'article', $id );
200201 }
201 - if ( !($i % (REPORTING_INTERVAL*10) ) ) {
 202+ if ( !($i % (self::REPORTING_INTERVAL*10) ) ) {
202203 print "\n";
203204 }
204205 $title = Title::newFromID( $id );
@@ -293,7 +294,7 @@
294295 }
295296
296297 wfWaitForSlaves( 10 );
297 - if ( !( ++$i % REPORTING_INTERVAL ) ) {
 298+ if ( !( ++$i % self::REPORTING_INTERVAL ) ) {
298299 print "{$row->img_name}\n";
299300 if ( $row->img_name !== 'done' ) {
300301 $this->setCheckpoint( 'local image', $row->img_name );
@@ -343,7 +344,7 @@
344345 if ( $file[0] == '.' ) {
345346 continue;
346347 }
347 - if ( !(++$i % REPORTING_INTERVAL ) ) {
 348+ if ( !(++$i % self::REPORTING_INTERVAL ) ) {
348349 print "$rel $i\r";
349350 }
350351
@@ -398,7 +399,7 @@
399400 }
400401
401402 wfWaitForSlaves( 10 );
402 - if ( !(++$i % REPORTING_INTERVAL ) ) {
 403+ if ( !(++$i % self::REPORTING_INTERVAL ) ) {
403404 print "{$row->cl_to}\n";
404405 if ( $row->cl_to != 'done' ) {
405406 $this->setCheckpoint( 'category', $row->cl_to );
@@ -451,7 +452,7 @@
452453
453454 while ( $row = $dbr->fetchObject( $res ) ) {
454455 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
455 - if ( !(++$i % (REPORTING_INTERVAL*10) ) ) {
 456+ if ( !(++$i % (self::REPORTING_INTERVAL*10) ) ) {
456457 printf( "Done %d redirects (%2.3f%%)\n", $i, $row->page_id / $end * 100 );
457458 $this->setCheckpoint( 'redirect', $row->page_id );
458459 }

Status & tagging log