MediaWiki master
purgeRecentChanges.php
Go to the documentation of this file.
1<?php
23
24// @codeCoverageIgnoreStart
25require_once __DIR__ . '/Maintenance.php';
26// @codeCoverageIgnoreEnd
27
39 public function __construct() {
40 parent::__construct();
41 $this->addDescription( 'Purge rows from the recentchanges table which are older than wgRCMaxAge.' );
42 }
43
44 public function execute() {
45 // Run directly instead of pushing to the job queue, so that the script will exit only once the
46 // purge is complete. If a job is already running to do the purge, then the script will exit early.
47 // However, this is fine because a purge is already in progress.
48 $recentChangesPruneJob = RecentChangesUpdateJob::newPurgeJob();
49 $recentChangesPruneJob->run();
50 $this->output( "Finished purging data from recentchanges.\n" );
51 }
52}
53
54// @codeCoverageIgnoreStart
55$maintClass = PurgeRecentChanges::class;
56require_once RUN_MAINTENANCE_IF_MAIN;
57// @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.