MediaWiki  master
UserGroupManagerFactory.php
Go to the documentation of this file.
1 <?php
21 namespace MediaWiki\User;
22 
26 use Psr\Log\LoggerInterface;
28 
37  private $options;
38 
41 
44 
47 
49  private $logger;
50 
53 
55  private $hookContainer;
56 
66  public function __construct(
72  LoggerInterface $logger,
73  array $clearCacheCallbacks = []
74  ) {
75  $this->options = $options;
76  $this->configuredReadOnlyMode = $configuredReadOnlyMode;
77  $this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
78  $this->hookContainer = $hookContainer;
79  $this->userEditTracker = $userEditTracker;
80  $this->logger = $logger;
81  $this->clearCacheCallbacks = $clearCacheCallbacks;
82  }
83 
88  public function getUserGroupManager( $dbDomain = false ) : UserGroupManager {
89  // TODO: Once UserRightsProxy is removed, cache the instance per domain.
90  return new UserGroupManager(
91  $this->options,
92  $this->configuredReadOnlyMode,
93  $this->dbLoadBalancerFactory,
94  $this->hookContainer,
95  $this->userEditTracker,
96  $this->logger,
97  $this->clearCacheCallbacks,
98  $dbDomain
99  );
100  }
101 }
ConfiguredReadOnlyMode
A read-only mode service which does not depend on LoadBalancer.
Definition: ConfiguredReadOnlyMode.php:9
MediaWiki\User\UserGroupManager
Managers user groups.
Definition: UserGroupManager.php:51
MediaWiki\User\UserGroupManagerFactory\$dbLoadBalancerFactory
ILBFactory $dbLoadBalancerFactory
Definition: UserGroupManagerFactory.php:43
MediaWiki\Config\ServiceOptions
A class for passing options to services.
Definition: ServiceOptions.php:25
MediaWiki\User\UserGroupManagerFactory\$options
ServiceOptions $options
Definition: UserGroupManagerFactory.php:37
MediaWiki\User\UserGroupManagerFactory\$logger
LoggerInterface $logger
Definition: UserGroupManagerFactory.php:49
MediaWiki\User\UserGroupManagerFactory\$clearCacheCallbacks
callable[] $clearCacheCallbacks
Definition: UserGroupManagerFactory.php:52
MediaWiki\User\UserGroupManagerFactory
Factory service for UserGroupManager instances.
Definition: UserGroupManagerFactory.php:35
MediaWiki\User
Definition: DefaultOptionsLookup.php:21
MediaWiki\User\UserGroupManagerFactory\$configuredReadOnlyMode
ConfiguredReadOnlyMode $configuredReadOnlyMode
Definition: UserGroupManagerFactory.php:40
MediaWiki\User\UserEditTracker
Track info about user edit counts and timings.
Definition: UserEditTracker.php:19
MediaWiki\HookContainer\HookContainer
HookContainer class.
Definition: HookContainer.php:44
MediaWiki\User\UserGroupManagerFactory\$hookContainer
HookContainer $hookContainer
Definition: UserGroupManagerFactory.php:55
Wikimedia\Rdbms\ILBFactory
An interface for generating database load balancers.
Definition: ILBFactory.php:33
MediaWiki\User\UserGroupManagerFactory\getUserGroupManager
getUserGroupManager( $dbDomain=false)
Definition: UserGroupManagerFactory.php:88
MediaWiki\User\UserGroupManagerFactory\$userEditTracker
UserEditTracker $userEditTracker
Definition: UserGroupManagerFactory.php:46
MediaWiki\User\UserGroupManagerFactory\__construct
__construct(ServiceOptions $options, ConfiguredReadOnlyMode $configuredReadOnlyMode, ILBFactory $dbLoadBalancerFactory, HookContainer $hookContainer, UserEditTracker $userEditTracker, LoggerInterface $logger, array $clearCacheCallbacks=[])
Definition: UserGroupManagerFactory.php:66