MediaWiki
REL1_35
purgeExpiredBlocks.php
Go to the documentation of this file.
1
<?php
22
use
MediaWiki\Block\DatabaseBlock
;
23
24
require_once __DIR__ .
'/Maintenance.php'
;
25
26
/*
27
* Maintenance script to remove expired blocks
28
*
29
* @since 1.35
30
* @author DannyS712
31
*/
32
33
class
PurgeExpiredBlocks
extends
Maintenance
{
34
public
function
__construct
() {
35
parent::__construct();
36
$this->
addDescription
(
'Remove expired blocks.'
);
37
}
38
39
public
function
execute
() {
40
$this->
output
(
"Purging expired blocks...\n"
);
41
42
DatabaseBlock::purgeExpired();
43
44
$this->
output
(
"Done purging expired blocks.\n"
);
45
}
46
}
47
48
$maintClass
= PurgeExpiredBlocks::class;
49
require_once
RUN_MAINTENANCE_IF_MAIN
;
RUN_MAINTENANCE_IF_MAIN
const RUN_MAINTENANCE_IF_MAIN
Definition
Maintenance.php:38
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition
Maintenance.php:55
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition
Maintenance.php:432
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition
Maintenance.php:325
MediaWiki\Block\DatabaseBlock
A DatabaseBlock (unlike a SystemBlock) is stored in the database, may give rise to autoblocks and may...
Definition
DatabaseBlock.php:54
PurgeExpiredBlocks
Definition
purgeExpiredBlocks.php:33
PurgeExpiredBlocks\execute
execute()
Do the actual work.
Definition
purgeExpiredBlocks.php:39
PurgeExpiredBlocks\__construct
__construct()
Default constructor.
Definition
purgeExpiredBlocks.php:34
$maintClass
$maintClass
Definition
purgeExpiredBlocks.php:48
maintenance
purgeExpiredBlocks.php
Generated on Sat Apr 6 2024 00:08:28 for MediaWiki by
1.9.8