MediaWiki  REL1_22
deleteArchivedRevisions.inc
Go to the documentation of this file.
00001 <?php
00029 class DeleteArchivedRevisionsImplementation {
00030 
00039     public static function doDelete( $maint ) {
00040         $dbw = wfGetDB( DB_MASTER );
00041 
00042         $dbw->begin( __METHOD__ );
00043 
00044         $tbl_arch = $dbw->tableName( 'archive' );
00045 
00046         # Delete as appropriate
00047         $maint->handleOutput( "Deleting archived revisions... " );
00048         $dbw->query( "DELETE FROM $tbl_arch" );
00049 
00050         $count = $dbw->affectedRows();
00051         $deletedRows = $count != 0;
00052 
00053         $maint->handleOutput( "done. $count revisions deleted.\n" );
00054 
00055         # This bit's done
00056         # Purge redundant text records
00057         $dbw->commit( __METHOD__ );
00058         if ( $deletedRows ) {
00059             $maint->purgeRedundantText( true );
00060         }
00061     }
00062 }