Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| PurgeExpiredBlocks | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| execute | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * @license GPL-2.0-or-later |
| 4 | * @file |
| 5 | */ |
| 6 | |
| 7 | use MediaWiki\Maintenance\Maintenance; |
| 8 | |
| 9 | // @codeCoverageIgnoreStart |
| 10 | require_once __DIR__ . '/Maintenance.php'; |
| 11 | // @codeCoverageIgnoreEnd |
| 12 | |
| 13 | /** |
| 14 | * Remove expired blocks from the block and ipblocks_restrictions tables |
| 15 | * |
| 16 | * @since 1.35 |
| 17 | * @ingroup Maintenance |
| 18 | * @author DannyS712 |
| 19 | */ |
| 20 | class PurgeExpiredBlocks extends Maintenance { |
| 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; |
| 37 | require_once RUN_MAINTENANCE_IF_MAIN; |
| 38 | // @codeCoverageIgnoreEnd |