mDescription = "Deletes all archived revisions\nThese revisions will no longer be restorable"; $this->addOption( 'delete', 'Performs the deletion' ); } public function handleOutput($str) { $this->output($str); } public function execute() { $this->output( "Delete archived revisions\n\n" ); # Data should come off the master, wrapped in a transaction if( $this->hasOption('delete') ) { DeleteArchivedRevisionsImplementation::doDelete($this); } else { $dbw = wfGetDB( DB_MASTER ); $res = $dbw->selectRow( 'archive', 'COUNT(*) as count', array(), __FUNCTION__ ); $this->output( "Found {$res->count} revisions to delete.\n" ); $this->output( "Please run the script again with the --delete option to really delete the revisions.\n" ); } } } $maintClass = "DeleteArchivedRevisions"; require_once( DO_MAINTENANCE );