Rename parameter, add phpdoc, fix bug in using $this from a statically called method.
authorMark A. Hershberger <mah@users.mediawiki.org>
Tue, 30 Mar 2010 17:19:00 +0000 (17:19 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Tue, 30 Mar 2010 17:19:00 +0000 (17:19 +0000)
maintenance/deleteArchivedRevisions.inc

index 94f2d47..3dee1c3 100644 (file)
 
 class DeleteArchivedRevisionsImplementation {
 
-       static public function doDelete($output) {
+       /**
+        * Perform the delete on archived revisions.
+
+        * @param $maint Object An object (typically of class Maintenance)
+        * that implements two methods: handleOutput() and
+        * purgeRedundantText().  See Maintenance for a description of
+        * those methods.
+        */
+       static public function doDelete($maint) {
                $dbw = wfGetDB( DB_MASTER );
 
                $dbw->begin();
@@ -31,19 +39,19 @@ class DeleteArchivedRevisionsImplementation {
                $tbl_arch = $dbw->tableName( 'archive' );
 
                # Delete as appropriate
-               $output->handleOutput( "Deleting archived revisions... " );
+               $maint->handleOutput( "Deleting archived revisions... " );
                $dbw->query( "DELETE FROM $tbl_arch" );
 
                $count = $dbw->affectedRows();
                $deletedRows = $count != 0;
 
-               $output->handleOutput( "done. $count revisions deleted.\n" );
+               $maint->handleOutput( "done. $count revisions deleted.\n" );
 
                # This bit's done
                # Purge redundant text records
                $dbw->commit();
                if( $deletedRows ) {
-                       $this->purgeRedundantText( true );
+                       $maint->purgeRedundantText( true );
                }
        }
 }
\ No newline at end of file