MediaWiki master
UserGroupManagerFactory.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\User;
8
15
24
28 private $instances = [];
29
40 public function __construct(
41 private readonly ServiceOptions $options,
42 private readonly ReadOnlyMode $readOnlyMode,
43 private readonly ILBFactory $dbLoadBalancerFactory,
44 private readonly HookContainer $hookContainer,
45 private readonly JobQueueGroupFactory $jobQueueGroupFactory,
46 private readonly TempUserConfig $tempUserConfig,
47 private readonly UserRequirementsConditionCheckerFactory $userRequirementsConditionCheckerFactory,
48 private readonly array $clearCacheCallbacks = [],
49 ) {
50 }
51
57 if ( is_string( $wikiId ) && $this->dbLoadBalancerFactory->getLocalDomainID() === $wikiId ) {
58 $wikiId = UserIdentity::LOCAL;
59 }
60 $key = (string)$wikiId;
61 if ( !isset( $this->instances[$key] ) ) {
62 $this->instances[$key] = new UserGroupManager(
63 $this->options,
64 $this->readOnlyMode,
65 $this->dbLoadBalancerFactory,
66 $this->hookContainer,
67 $this->jobQueueGroupFactory->makeJobQueueGroup( $wikiId ),
68 $this->tempUserConfig,
69 $this->userRequirementsConditionCheckerFactory,
70 $this->clearCacheCallbacks,
71 $wikiId
72 );
73 }
74 return $this->instances[$key];
75 }
76}
if(!defined('MW_SETUP_CALLBACK'))
Definition WebStart.php:68
A class for passing options to services.
Factory for JobQueueGroup objects.
Factory service for UserGroupManager instances.
getUserGroupManager( $wikiId=UserIdentity::LOCAL)
__construct(private readonly ServiceOptions $options, private readonly ReadOnlyMode $readOnlyMode, private readonly ILBFactory $dbLoadBalancerFactory, private readonly HookContainer $hookContainer, private readonly JobQueueGroupFactory $jobQueueGroupFactory, private readonly TempUserConfig $tempUserConfig, private readonly UserRequirementsConditionCheckerFactory $userRequirementsConditionCheckerFactory, private readonly array $clearCacheCallbacks=[],)
Manage user group memberships.
Determine whether a site is currently in read-only mode.
const LOCAL
Wiki ID value to use with instances that are defined relative to the local wiki.
Interface for temporary user creation config and name matching.
Manager of ILoadBalancer objects and, indirectly, IDatabase connections.