MediaWiki  master
UserGroupManagerFactory.php
Go to the documentation of this file.
1 <?php
21 namespace MediaWiki\User;
22 
28 use Psr\Log\LoggerInterface;
30 
39  private $options;
40 
43 
46 
49 
52 
55 
57  private $logger;
58 
61 
63  private $hookContainer;
64 
76  public function __construct(
82  GroupPermissionsLookup $groupPermissionsLookup,
84  LoggerInterface $logger,
85  array $clearCacheCallbacks = []
86  ) {
87  $this->options = $options;
88  $this->configuredReadOnlyMode = $configuredReadOnlyMode;
89  $this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
90  $this->hookContainer = $hookContainer;
91  $this->userEditTracker = $userEditTracker;
92  $this->groupPermissionLookup = $groupPermissionsLookup;
93  $this->jobQueueGroupFactory = $jobQueueGroupFactory;
94  $this->logger = $logger;
95  $this->clearCacheCallbacks = $clearCacheCallbacks;
96  }
97 
102  public function getUserGroupManager( $dbDomain = false ): UserGroupManager {
103  // TODO: Once UserRightsProxy is removed, cache the instance per domain.
104  return new UserGroupManager(
105  $this->options,
106  $this->configuredReadOnlyMode,
107  $this->dbLoadBalancerFactory,
108  $this->hookContainer,
109  $this->userEditTracker,
110  $this->groupPermissionLookup,
111  $this->jobQueueGroupFactory->makeJobQueueGroup( $dbDomain ),
112  $this->logger,
113  $this->clearCacheCallbacks,
114  $dbDomain
115  );
116  }
117 }
MediaWiki\Permissions\GroupPermissionsLookup
Definition: GroupPermissionsLookup.php:30
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:52
MediaWiki\User\UserGroupManagerFactory\$dbLoadBalancerFactory
ILBFactory $dbLoadBalancerFactory
Definition: UserGroupManagerFactory.php:45
MediaWiki\Config\ServiceOptions
A class for passing options to services.
Definition: ServiceOptions.php:27
MediaWiki\User\UserGroupManagerFactory\$options
ServiceOptions $options
Definition: UserGroupManagerFactory.php:39
MediaWiki\User\UserGroupManagerFactory\$logger
LoggerInterface $logger
Definition: UserGroupManagerFactory.php:57
MediaWiki\User\UserGroupManagerFactory\__construct
__construct(ServiceOptions $options, ConfiguredReadOnlyMode $configuredReadOnlyMode, ILBFactory $dbLoadBalancerFactory, HookContainer $hookContainer, UserEditTracker $userEditTracker, GroupPermissionsLookup $groupPermissionsLookup, JobQueueGroupFactory $jobQueueGroupFactory, LoggerInterface $logger, array $clearCacheCallbacks=[])
Definition: UserGroupManagerFactory.php:76
MediaWiki\User\UserGroupManagerFactory\$clearCacheCallbacks
callable[] $clearCacheCallbacks
Definition: UserGroupManagerFactory.php:60
MediaWiki\User\UserGroupManagerFactory
Factory service for UserGroupManager instances.
Definition: UserGroupManagerFactory.php:37
MediaWiki\JobQueue\JobQueueGroupFactory
Class to construct JobQueueGroups.
Definition: JobQueueGroupFactory.php:37
MediaWiki\User
Definition: ActorCache.php:21
MediaWiki\User\UserGroupManagerFactory\$jobQueueGroupFactory
JobQueueGroupFactory $jobQueueGroupFactory
Definition: UserGroupManagerFactory.php:54
MediaWiki\User\UserGroupManagerFactory\$configuredReadOnlyMode
ConfiguredReadOnlyMode $configuredReadOnlyMode
Definition: UserGroupManagerFactory.php:42
MediaWiki\User\UserEditTracker
Track info about user edit counts and timings.
Definition: UserEditTracker.php:21
MediaWiki\User\UserGroupManagerFactory\$groupPermissionLookup
GroupPermissionsLookup $groupPermissionLookup
Definition: UserGroupManagerFactory.php:51
MediaWiki\HookContainer\HookContainer
HookContainer class.
Definition: HookContainer.php:45
MediaWiki\User\UserGroupManagerFactory\$hookContainer
HookContainer $hookContainer
Definition: UserGroupManagerFactory.php:63
Wikimedia\Rdbms\ILBFactory
An interface for generating database load balancers.
Definition: ILBFactory.php:33
MediaWiki\User\UserGroupManagerFactory\getUserGroupManager
getUserGroupManager( $dbDomain=false)
Definition: UserGroupManagerFactory.php:102
MediaWiki\User\UserGroupManagerFactory\$userEditTracker
UserEditTracker $userEditTracker
Definition: UserGroupManagerFactory.php:48