MediaWiki master
purgeExpiredBlocks.php
Go to the documentation of this file.
1<?php
8
9// @codeCoverageIgnoreStart
10require_once __DIR__ . '/Maintenance.php';
11// @codeCoverageIgnoreEnd
12
21 public function __construct() {
22 parent::__construct();
23 $this->addDescription( 'Remove expired blocks.' );
24 }
25
26 public function execute() {
27 $this->output( "Purging expired blocks...\n" );
28
29 $this->getServiceContainer()->getDatabaseBlockStore()->purgeExpiredBlocks();
30
31 $this->output( "Done purging expired blocks.\n" );
32 }
33}
34
35// @codeCoverageIgnoreStart
36$maintClass = PurgeExpiredBlocks::class;
37require_once RUN_MAINTENANCE_IF_MAIN;
38// @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.
Remove expired blocks from the block and ipblocks_restrictions tables.
execute()
Do the actual work.
__construct()
Default constructor.