MediaWiki  1.23.2
deleteArchivedRevisions.php
Go to the documentation of this file.
1 <?php
27 require_once __DIR__ . '/Maintenance.php';
28 require_once __DIR__ . '/deleteArchivedRevisions.inc';
29 
37  public function __construct() {
38  parent::__construct();
39  $this->mDescription = "Deletes all archived revisions\nThese revisions will no longer be restorable";
40  $this->addOption( 'delete', 'Performs the deletion' );
41  }
42 
43  public function handleOutput( $str ) {
44  $this->output( $str );
45  }
46 
47  public function execute() {
48  $this->output( "Delete archived revisions\n\n" );
49  # Data should come off the master, wrapped in a transaction
50  if ( $this->hasOption( 'delete' ) ) {
52  } else {
53  $dbw = wfGetDB( DB_MASTER );
54  $res = $dbw->selectRow( 'archive', 'COUNT(*) as count', array(), __FUNCTION__ );
55  $this->output( "Found {$res->count} revisions to delete.\n" );
56  $this->output( "Please run the script again with the --delete option to really delete the revisions.\n" );
57  }
58  }
59 }
60 
61 $maintClass = "DeleteArchivedRevisions";
62 require_once RUN_MAINTENANCE_IF_MAIN;
DB_MASTER
const DB_MASTER
Definition: Defines.php:56
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
wfGetDB
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3650
Maintenance\addOption
addOption( $name, $description, $required=false, $withArg=false, $shortName=false)
Add a parameter to the script.
Definition: Maintenance.php:169
DeleteArchivedRevisionsImplementation\doDelete
static doDelete( $maint)
Perform the delete on archived revisions.
Definition: deleteArchivedRevisions.inc:39
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition: maintenance.txt:50
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: maintenance.txt:39
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
DeleteArchivedRevisions\handleOutput
handleOutput( $str)
Definition: deleteArchivedRevisions.php:43
DeleteArchivedRevisions\__construct
__construct()
Default constructor.
Definition: deleteArchivedRevisions.php:37
DeleteArchivedRevisions\execute
execute()
Do the actual work.
Definition: deleteArchivedRevisions.php:47
$maintClass
$maintClass
Definition: deleteArchivedRevisions.php:61
DeleteArchivedRevisions
Maintenance script to delete archived (deleted from public) revisions from the database.
Definition: deleteArchivedRevisions.php:36
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition: Maintenance.php:314
Maintenance\hasOption
hasOption( $name)
Checks to see if a particular param exists.
Definition: Maintenance.php:181
$res
$res
Definition: database.txt:21