MediaWiki master
purgeRecentChanges.php
Go to the documentation of this file.
1<?php
9
10// @codeCoverageIgnoreStart
11require_once __DIR__ . '/Maintenance.php';
12// @codeCoverageIgnoreEnd
13
25 public function __construct() {
26 parent::__construct();
27 $this->addDescription( 'Purge rows from the recentchanges table which are older than wgRCMaxAge.' );
28 }
29
30 public function execute() {
31 // Run directly instead of pushing to the job queue, so that the script will exit only once the
32 // purge is complete. If a job is already running to do the purge, then the script will exit early.
33 // However, this is fine because a purge is already in progress.
34 $recentChangesPruneJob = RecentChangesUpdateJob::newPurgeJob();
35 $recentChangesPruneJob->run();
36 $this->output( "Finished purging data from recentchanges.\n" );
37 }
38}
39
40// @codeCoverageIgnoreStart
41$maintClass = PurgeRecentChanges::class;
42require_once RUN_MAINTENANCE_IF_MAIN;
43// @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 expired rows from the recentchanges table.
Purge rows from the recentchanges table older than wgRCMaxAge.
__construct()
Default constructor.
execute()
Do the actual work.