X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/mediawiki.git/blobdiff_plain/87219ebd28426c6d21cb545233ee52f5f7af7dfd..refs/tags/mediawiki-1.17.0:/maintenance/cleanupTable.inc diff --git a/maintenance/cleanupTable.inc b/maintenance/cleanupTable.inc index 3549a9a1..67a32510 100644 --- a/maintenance/cleanupTable.inc +++ b/maintenance/cleanupTable.inc @@ -17,10 +17,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * + * @file * @ingroup Maintenance */ -require_once( dirname(__FILE__) . '/Maintenance.php' ); +require_once( dirname( __FILE__ ) . '/Maintenance.php' ); class TableCleanup extends Maintenance { protected $defaultParams = array( @@ -44,7 +45,7 @@ class TableCleanup extends Maintenance { global $wgUser; $wgUser->setName( 'Conversion script' ); $this->dryrun = $this->hasOption( 'dry-run' ); - if( $this->dryrun ) { + if ( $this->dryrun ) { $this->output( "Checking for bad titles...\n" ); } else { $this->output( "Checking and fixing bad titles...\n" ); @@ -63,7 +64,7 @@ class TableCleanup extends Maintenance { protected function progress( $updated ) { $this->updated += $updated; $this->processed++; - if( $this->processed % $this->reportInterval != 0 ) { + if ( $this->processed % $this->reportInterval != 0 ) { return; } $portion = $this->processed / $this->count; @@ -74,7 +75,7 @@ class TableCleanup extends Maintenance { $estimatedTotalTime = $delta / $portion; $eta = $this->startTime + $estimatedTotalTime; - $this->output( + $this->output( sprintf( "%s %s: %6.2f%% done on %s; ETA %s [%d/%d] %.2f/sec <%.2f%% updated>\n", wfWikiID(), wfTimestamp( TS_DB, intval( $now ) ), @@ -84,7 +85,7 @@ class TableCleanup extends Maintenance { $this->processed, $this->count, $this->processed / $delta, - $updateRate * 100.0 + $updateRate * 100.0 ) ); flush(); @@ -94,9 +95,9 @@ class TableCleanup extends Maintenance { $dbr = wfGetDB( DB_SLAVE ); if ( array_diff( array_keys( $params ), - array( 'table', 'conds', 'index', 'callback' ) ) ) + array( 'table', 'conds', 'index', 'callback' ) ) ) { - throw new MWException( __METHOD__.': Missing parameter ' . implode( ', ', $params ) ); + throw new MWException( __METHOD__ . ': Missing parameter ' . implode( ', ', $params ) ); } $table = $params['table'];