MediaWiki REL1_34
purgeExpiredUserrights.php
Go to the documentation of this file.
1<?php
23require_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" );
39 $res = UserGroupMembership::purgeExpired();
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;
49require_once RUN_MAINTENANCE_IF_MAIN;
const RUN_MAINTENANCE_IF_MAIN
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
addDescription( $text)
Set the description text.
Remove expired userrights from user_groups table and move them to former_user_groups.
__construct()
Default constructor.