MediaWiki master
purgeOldText.php
Go to the documentation of this file.
1<?php
26
27// @codeCoverageIgnoreStart
28require_once __DIR__ . '/Maintenance.php';
29// @codeCoverageIgnoreEnd
30
37 public function __construct() {
38 parent::__construct();
39 $this->addDescription( 'Purge old text records from the database' );
40 $this->addOption( 'purge', 'Performs the deletion' );
41 }
42
43 public function execute() {
44 $this->purgeRedundantText( $this->hasOption( 'purge' ) );
45 }
46}
47
48// @codeCoverageIgnoreStart
49$maintClass = PurgeOldText::class;
50require_once RUN_MAINTENANCE_IF_MAIN;
51// @codeCoverageIgnoreEnd
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
hasOption( $name)
Checks to see if a particular option was set.
purgeRedundantText( $delete=true)
Support function for cleaning up redundant text records.
addDescription( $text)
Set the description text.
Maintenance script that purges old text records from the database.
__construct()
Default constructor.
execute()
Do the actual work.
$maintClass