MediaWiki master
purgeExpiredBlocks.php
Go to the documentation of this file.
1<?php
21require_once __DIR__ . '/Maintenance.php';
22
23/*
24 * Remove expired blocks from the ipblocks and ipblocks_restrictions tables
25 *
26 * @since 1.35
27 * @ingroup Maintenance
28 * @author DannyS712
29 */
30
32 public function __construct() {
33 parent::__construct();
34 $this->addDescription( 'Remove expired blocks.' );
35 }
36
37 public function execute() {
38 $this->output( "Purging expired blocks...\n" );
39
40 $this->getServiceContainer()->getDatabaseBlockStore()->purgeExpiredBlocks();
41
42 $this->output( "Done purging expired blocks.\n" );
43 }
44}
45
46$maintClass = PurgeExpiredBlocks::class;
47require_once RUN_MAINTENANCE_IF_MAIN;
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.
execute()
Do the actual work.
__construct()
Default constructor.