MediaWiki master
purgeRecentChanges.php
Go to the documentation of this file.
1<?php
21// @codeCoverageIgnoreStart
22require_once __DIR__ . '/Maintenance.php';
23// @codeCoverageIgnoreEnd
24
36 public function __construct() {
37 parent::__construct();
38 $this->addDescription( 'Purge rows from the recentchanges table which are older than wgRCMaxAge.' );
39 }
40
41 public function execute() {
42 // Run directly instead of pushing to the job queue, so that the script will exit only once the
43 // purge is complete. If a job is already running to do the purge, then the script will exit early.
44 // However, this is fine because a purge is already in progress.
45 $recentChangesPruneJob = RecentChangesUpdateJob::newPurgeJob();
46 $recentChangesPruneJob->run();
47 $this->output( "Finished purging data from recentchanges.\n" );
48 }
49}
50
51// @codeCoverageIgnoreStart
52$maintClass = PurgeRecentChanges::class;
53require_once RUN_MAINTENANCE_IF_MAIN;
54// @codeCoverageIgnoreEnd
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
addDescription( $text)
Set the description text.
Purge rows from the recentchanges table older than wgRCMaxAge.
__construct()
Default constructor.
execute()
Do the actual work.