Proof of concept parallel processing with Danga Gearman and PEAR Net_Gearman.
[lhc/web/wiklou.git] / maintenance / deleteArchivedRevisions.inc
1 <?php
2
3 /**
4 * Support functions for the deleteArchivedRevisions script
5 *
6 * @file
7 * @ingroup Maintenance
8 * @author Aaron Schulz
9 */
10
11 require_once( 'purgeOldText.inc' );
12
13 function DeleteArchivedRevisions( $delete = false ) {
14
15 # Data should come off the master, wrapped in a transaction
16 $dbw = wfGetDB( DB_MASTER );
17 $dbw->begin();
18
19 $tbl_arch = $dbw->tableName( 'archive' );
20 # Delete as appropriate
21 echo( "Deleting archived revisions..." );
22 $dbw->query( "TRUNCATE TABLE $tbl_arch" );
23 echo( "done.\n" );
24
25 $delete = $dbw->affectedRows() != 0;
26
27 # This bit's done
28 # Purge redundant text records
29 $dbw->commit();
30 if( $delete ) {
31 PurgeRedundantText( true );
32 }
33
34 }