MediaWiki master
purgeExpiredUserrights.php
Go to the documentation of this file.
1<?php
8
9// @codeCoverageIgnoreStart
10require_once __DIR__ . '/Maintenance.php';
11// @codeCoverageIgnoreEnd
12
30 public function __construct() {
31 parent::__construct();
32 $this->addDescription( 'Move expired userrights from user_groups to former_user_groups table.' );
33 }
34
35 public function execute() {
36 $this->output( "Purging expired user rights...\n" );
37 $res = $this->getServiceContainer()->getUserGroupManager()->purgeExpired();
38 if ( $res === false ) {
39 $this->output( "Purging failed.\n" );
40 } else {
41 $this->output( "$res rows purged.\n" );
42 }
43 }
44}
45
46// @codeCoverageIgnoreStart
47$maintClass = PurgeExpiredUserrights::class;
48require_once RUN_MAINTENANCE_IF_MAIN;
49// @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 userrights from user_groups table and move them to former_user_groups.
__construct()
Default constructor.