MediaWiki master
purgeExpiredBlocks.php
Go to the documentation of this file.
1<?php
21// @codeCoverageIgnoreStart
22require_once __DIR__ . '/Maintenance.php';
23// @codeCoverageIgnoreEnd
24
25/*
26 * Remove expired blocks from the block and ipblocks_restrictions tables
27 *
28 * @since 1.35
29 * @ingroup Maintenance
30 * @author DannyS712
31 */
32
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 $this->getServiceContainer()->getDatabaseBlockStore()->purgeExpiredBlocks();
43
44 $this->output( "Done purging expired blocks.\n" );
45 }
46}
47
48// @codeCoverageIgnoreStart
49$maintClass = PurgeExpiredBlocks::class;
50require_once RUN_MAINTENANCE_IF_MAIN;
51// @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.