MediaWiki REL1_35
purgeExpiredUserrights.php
Go to the documentation of this file.
1<?php
24
25require_once __DIR__ . '/Maintenance.php';
26
27/*
28 * Maintenance script to move expired userrights to user_former_groups
29 *
30 * @since 1.31
31 */
32
34 public function __construct() {
35 parent::__construct();
36 $this->addDescription( 'Move expired userrights from user_groups to former_user_groups table.' );
37 }
38
39 public function execute() {
40 $this->output( "Purging expired user rights...\n" );
41 $res = MediaWikiServices::getInstance()->getUserGroupManager()->purgeExpired();
42 if ( $res === false ) {
43 $this->output( "Purging failed.\n" );
44 } else {
45 $this->output( "$res rows purged.\n" );
46 }
47 }
48}
49
50$maintClass = PurgeExpiredUserrights::class;
51require_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.
MediaWikiServices is the service locator for the application scope of MediaWiki.
__construct()
Default constructor.