MediaWiki
master
purgeRecentChanges.php
Go to the documentation of this file.
1
<?php
21
// @codeCoverageIgnoreStart
22
require_once __DIR__ .
'/Maintenance.php'
;
23
// @codeCoverageIgnoreEnd
24
35
class
PurgeRecentChanges
extends
Maintenance
{
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;
53
require_once RUN_MAINTENANCE_IF_MAIN;
54
// @codeCoverageIgnoreEnd
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition
Maintenance.php:70
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition
Maintenance.php:481
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition
Maintenance.php:331
PurgeRecentChanges
Purge rows from the recentchanges table older than wgRCMaxAge.
Definition
purgeRecentChanges.php:35
PurgeRecentChanges\__construct
__construct()
Default constructor.
Definition
purgeRecentChanges.php:36
PurgeRecentChanges\execute
execute()
Do the actual work.
Definition
purgeRecentChanges.php:41
$maintClass
$maintClass
Definition
purgeRecentChanges.php:52
maintenance
purgeRecentChanges.php
Generated on Sat Oct 5 2024 00:27:49 for MediaWiki by
1.10.0