MediaWiki
REL1_39
purgeExpiredUserrights.php
Go to the documentation of this file.
1
<?php
23
use
MediaWiki\MediaWikiServices
;
24
25
require_once __DIR__ .
'/Maintenance.php'
;
26
27
/*
28
* Maintenance script to move expired userrights to user_former_groups
29
*
30
* @since 1.31
31
*/
32
33
class
PurgeExpiredUserrights
extends
Maintenance
{
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;
51
require_once RUN_MAINTENANCE_IF_MAIN;
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition
Maintenance.php:66
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition
Maintenance.php:443
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition
Maintenance.php:319
MediaWiki\MediaWikiServices
Service locator for MediaWiki core services.
Definition
MediaWikiServices.php:212
PurgeExpiredUserrights
Definition
purgeExpiredUserrights.php:33
PurgeExpiredUserrights\execute
execute()
Do the actual work.
Definition
purgeExpiredUserrights.php:39
PurgeExpiredUserrights\__construct
__construct()
Default constructor.
Definition
purgeExpiredUserrights.php:34
$maintClass
$maintClass
Definition
purgeExpiredUserrights.php:50
$res
$res
Definition
testCompression.php:57
maintenance
purgeExpiredUserrights.php
Generated on Mon Dec 16 2024 06:37:18 for MediaWiki by
1.10.0