MediaWiki REL1_31
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;
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
addDescription( $text)
Set the description text.
Remove expired userrights from user_groups table and move them to former_user_groups.
__construct()
Default constructor.
$res
Definition database.txt:21
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling output() to send it all. It could be easily changed to send incrementally if that becomes useful
require_once RUN_MAINTENANCE_IF_MAIN