2020-07-08 02:57:32 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
2023-01-11 21:50:06 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
2020-07-08 02:57:32 +00:00
|
|
|
*
|
2023-01-11 21:50:06 +00:00
|
|
|
* @file
|
2020-07-08 02:57:32 +00:00
|
|
|
*/
|
|
|
|
|
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2020-07-08 02:57:32 +00:00
|
|
|
require_once __DIR__ . '/Maintenance.php';
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|
2020-07-08 02:57:32 +00:00
|
|
|
|
|
|
|
|
/*
|
2024-04-09 03:26:02 +00:00
|
|
|
* Remove expired blocks from the block and ipblocks_restrictions tables
|
2020-07-08 02:57:32 +00:00
|
|
|
*
|
|
|
|
|
* @since 1.35
|
2023-01-11 21:50:06 +00:00
|
|
|
* @ingroup Maintenance
|
2020-07-08 02:57:32 +00:00
|
|
|
* @author DannyS712
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class PurgeExpiredBlocks extends Maintenance {
|
|
|
|
|
public function __construct() {
|
|
|
|
|
parent::__construct();
|
|
|
|
|
$this->addDescription( 'Remove expired blocks.' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function execute() {
|
|
|
|
|
$this->output( "Purging expired blocks...\n" );
|
|
|
|
|
|
2023-08-31 09:21:12 +00:00
|
|
|
$this->getServiceContainer()->getDatabaseBlockStore()->purgeExpiredBlocks();
|
2020-07-08 02:57:32 +00:00
|
|
|
|
|
|
|
|
$this->output( "Done purging expired blocks.\n" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2020-07-08 02:57:32 +00:00
|
|
|
$maintClass = PurgeExpiredBlocks::class;
|
|
|
|
|
require_once RUN_MAINTENANCE_IF_MAIN;
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|