Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
PurgeSeen | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
execute | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace LoginNotify\Maintenance; |
4 | |
5 | use LoginNotify\LoginNotify; |
6 | |
7 | $IP = getenv( 'MW_INSTALL_PATH' ); |
8 | if ( $IP === false ) { |
9 | $IP = __DIR__ . '/../../..'; |
10 | } |
11 | |
12 | require_once "$IP/maintenance/Maintenance.php"; |
13 | |
14 | class 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; |
30 | require_once RUN_MAINTENANCE_IF_MAIN; |