addDescription( "Deletes all archived revisions\nThese revisions will no longer be restorable" ); $this->addOption( 'delete', 'Performs the deletion' ); } public function execute() { $dbw = $this->getDB( DB_MASTER ); if ( !$this->hasOption( 'delete' ) ) { $count = $dbw->selectField( 'archive', 'COUNT(*)', '', __METHOD__ ); $this->output( "Found $count revisions to delete.\n" ); $this->output( "Please run the script again with the --delete option " . "to really delete the revisions.\n" ); return; } $this->output( "Deleting archived revisions... " ); $dbw->delete( 'archive', '*', __METHOD__ ); $count = $dbw->affectedRows(); $this->output( "done. $count revisions deleted.\n" ); if ( $count ) { $this->purgeRedundantText( true ); } } } $maintClass = "DeleteArchivedRevisions"; require_once RUN_MAINTENANCE_IF_MAIN;