MediaWiki  master
purgeOldText.php
Go to the documentation of this file.
1 <?php
25 require_once __DIR__ . '/Maintenance.php';
26 
32 class PurgeOldText extends Maintenance {
33  public function __construct() {
34  parent::__construct();
35  $this->addDescription( 'Purge old text records from the database' );
36  $this->addOption( 'purge', 'Performs the deletion' );
37  }
38 
39  public function execute() {
40  $this->purgeRedundantText( $this->hasOption( 'purge' ) );
41  }
42 }
43 
44 $maintClass = PurgeOldText::class;
45 require_once RUN_MAINTENANCE_IF_MAIN;
const RUN_MAINTENANCE_IF_MAIN
Definition: Maintenance.php:39
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: Maintenance.php:86
hasOption( $name)
Checks to see if a particular option exists.
$maintClass
addDescription( $text)
Set the description text.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
purgeRedundantText( $delete=true)
Support function for cleaning up redundant text records.
Maintenance script that purges old text records from the database.