MediaWiki  1.33.0
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 
49 require_once RUN_MAINTENANCE_IF_MAIN;
$maintClass
$maintClass
Definition: purgeExpiredUserrights.php:48
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition: Maintenance.php:329
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition: maintenance.txt:50
$res
$res
Definition: database.txt:21
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: maintenance.txt:39
UserGroupMembership\purgeExpired
static purgeExpired()
Purge expired memberships from the user_groups table.
Definition: UserGroupMembership.php:243
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
PurgeExpiredUserrights
Remove expired userrights from user_groups table and move them to former_user_groups.
Definition: purgeExpiredUserrights.php:31
PurgeExpiredUserrights\execute
execute()
Do the actual work.
Definition: purgeExpiredUserrights.php:37
PurgeExpiredUserrights\__construct
__construct()
Default constructor.
Definition: purgeExpiredUserrights.php:32
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition: Maintenance.php:434
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52