Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
PurgeSeen
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 execute
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace LoginNotify\Maintenance;
4
5use LoginNotify\LoginNotify;
6
7$IP = getenv( 'MW_INSTALL_PATH' );
8if ( $IP === false ) {
9    $IP = __DIR__ . '/../../..';
10}
11
12require_once "$IP/maintenance/Maintenance.php";
13
14class PurgeSeen extends \Maintenance {
15    public function __construct() {
16        parent::__construct();
17        $this->addDescription( 'Purge expired user IP address information stored by LoginNotify' );
18    }
19
20    public function execute() {
21        $loginNotify = LoginNotify::getInstance();
22        $minId = $loginNotify->getMinExpiredId();
23        for ( ; $minId !== null; $this->waitForReplication() ) {
24            $minId = $loginNotify->purgeSeen( $minId );
25        }
26    }
27}
28
29$maintClass = PurgeSeen::class;
30require_once RUN_MAINTENANCE_IF_MAIN;