4 * Delete archived (deleted from public) revisions from the database
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * http://www.gnu.org/copyleft/gpl.html
21 * @ingroup Maintenance
24 class DeleteArchivedRevisionsImplementation {
27 * Perform the delete on archived revisions.
29 * @param $maint Object An object (typically of class Maintenance)
30 * that implements two methods: handleOutput() and
31 * purgeRedundantText(). See Maintenance for a description of
34 static public function doDelete( $maint ) {
35 $dbw = wfGetDB( DB_MASTER );
37 $dbw->begin( __METHOD__ );
39 $tbl_arch = $dbw->tableName( 'archive' );
41 # Delete as appropriate
42 $maint->handleOutput( "Deleting archived revisions... " );
43 $dbw->query( "DELETE FROM $tbl_arch" );
45 $count = $dbw->affectedRows();
46 $deletedRows = $count != 0;
48 $maint->handleOutput( "done. $count revisions deleted.\n" );
51 # Purge redundant text records
52 $dbw->commit( __METHOD__ );
54 $maint->purgeRedundantText( true );