]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - maintenance/cleanupTable.inc
MediaWiki 1.17.0
[autoinstalls/mediawiki.git] / maintenance / cleanupTable.inc
index 3549a9a19aed397233ab06197fee46cddb72fc64..67a325103fc016cfd7a3aa4c1ff52775969fe1ee 100644 (file)
  * 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'];