MediaWiki  master
purgeExpiredUserrights.php
Go to the documentation of this file.
1 <?php
23 require_once __DIR__ . '/Maintenance.php';
24 
25 /*
26  * Maintenance script to move expired userrights to user_former_groups
27  *
28  * @since 1.31
29  */
30 
32  public function __construct() {
33  parent::__construct();
34  $this->addDescription( 'Move expired userrights from user_groups to former_user_groups table.' );
35  }
36 
37  public function execute() {
38  $this->output( "Purging expired user rights...\n" );
40  if ( $res === false ) {
41  $this->output( "Purging failed.\n" );
42  } else {
43  $this->output( "$res rows purged.\n" );
44  }
45  }
46 }
47 
48 $maintClass = PurgeExpiredUserrights::class;
49 require_once RUN_MAINTENANCE_IF_MAIN;
const RUN_MAINTENANCE_IF_MAIN
Definition: Maintenance.php:39
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: Maintenance.php:86
addDescription( $text)
Set the description text.
Remove expired userrights from user_groups table and move them to former_user_groups.
output( $out, $channel=null)
Throw some output to the user.
static purgeExpired()
Purge expired memberships from the user_groups table.