MediaWiki
REL1_19
|
00001 <?php 00002 00026 require_once( dirname( __FILE__ ) . '/Maintenance.php' ); 00027 require_once( dirname( __FILE__ ) . '/deleteArchivedRevisions.inc' ); 00028 00029 class DeleteArchivedRevisions extends Maintenance { 00030 public function __construct() { 00031 parent::__construct(); 00032 $this->mDescription = "Deletes all archived revisions\nThese revisions will no longer be restorable"; 00033 $this->addOption( 'delete', 'Performs the deletion' ); 00034 } 00035 00036 public function handleOutput( $str ) { 00037 $this->output( $str ); 00038 } 00039 00040 public function execute() { 00041 $this->output( "Delete archived revisions\n\n" ); 00042 # Data should come off the master, wrapped in a transaction 00043 if ( $this->hasOption( 'delete' ) ) { 00044 DeleteArchivedRevisionsImplementation::doDelete( $this ); 00045 } else { 00046 $dbw = wfGetDB( DB_MASTER ); 00047 $res = $dbw->selectRow( 'archive', 'COUNT(*) as count', array(), __FUNCTION__ ); 00048 $this->output( "Found {$res->count} revisions to delete.\n" ); 00049 $this->output( "Please run the script again with the --delete option to really delete the revisions.\n" ); 00050 } 00051 } 00052 } 00053 00054 $maintClass = "DeleteArchivedRevisions"; 00055 require_once( RUN_MAINTENANCE_IF_MAIN );