MediaWiki master
purgeExpiredBlocks.php
Go to the documentation of this file.
1<?php
22
23// @codeCoverageIgnoreStart
24require_once __DIR__ . '/Maintenance.php';
25// @codeCoverageIgnoreEnd
26
27/*
28 * Remove expired blocks from the block and ipblocks_restrictions tables
29 *
30 * @since 1.35
31 * @ingroup Maintenance
32 * @author DannyS712
33 */
35 public function __construct() {
36 parent::__construct();
37 $this->addDescription( 'Remove expired blocks.' );
38 }
39
40 public function execute() {
41 $this->output( "Purging expired blocks...\n" );
42
43 $this->getServiceContainer()->getDatabaseBlockStore()->purgeExpiredBlocks();
44
45 $this->output( "Done purging expired blocks.\n" );
46 }
47}
48
49// @codeCoverageIgnoreStart
50$maintClass = PurgeExpiredBlocks::class;
51require_once RUN_MAINTENANCE_IF_MAIN;
52// @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.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.
execute()
Do the actual work.
__construct()
Default constructor.