MediaWiki  master
UserGroupManagerFactory.php
Go to the documentation of this file.
1 <?php
21 namespace MediaWiki\User;
22 
27 use Psr\Log\LoggerInterface;
29 
38  private $options;
39 
42 
45 
48 
51 
53  private $logger;
54 
57 
59  private $hookContainer;
60 
71  public function __construct(
77  GroupPermissionsLookup $groupPermissionsLookup,
78  LoggerInterface $logger,
79  array $clearCacheCallbacks = []
80  ) {
81  $this->options = $options;
82  $this->configuredReadOnlyMode = $configuredReadOnlyMode;
83  $this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
84  $this->hookContainer = $hookContainer;
85  $this->userEditTracker = $userEditTracker;
86  $this->groupPermissionLookup = $groupPermissionsLookup;
87  $this->logger = $logger;
88  $this->clearCacheCallbacks = $clearCacheCallbacks;
89  }
90 
95  public function getUserGroupManager( $dbDomain = false ) : UserGroupManager {
96  // TODO: Once UserRightsProxy is removed, cache the instance per domain.
97  return new UserGroupManager(
98  $this->options,
99  $this->configuredReadOnlyMode,
100  $this->dbLoadBalancerFactory,
101  $this->hookContainer,
102  $this->userEditTracker,
103  $this->groupPermissionLookup,
104  $this->logger,
105  $this->clearCacheCallbacks,
106  $dbDomain
107  );
108  }
109 }
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:44
MediaWiki\Config\ServiceOptions
A class for passing options to services.
Definition: ServiceOptions.php:27
MediaWiki\User\UserGroupManagerFactory\$options
ServiceOptions $options
Definition: UserGroupManagerFactory.php:38
MediaWiki\User\UserGroupManagerFactory\$logger
LoggerInterface $logger
Definition: UserGroupManagerFactory.php:53
MediaWiki\User\UserGroupManagerFactory\$clearCacheCallbacks
callable[] $clearCacheCallbacks
Definition: UserGroupManagerFactory.php:56
MediaWiki\User\UserGroupManagerFactory
Factory service for UserGroupManager instances.
Definition: UserGroupManagerFactory.php:36
MediaWiki\User
Definition: ActorCache.php:21
MediaWiki\User\UserGroupManagerFactory\$configuredReadOnlyMode
ConfiguredReadOnlyMode $configuredReadOnlyMode
Definition: UserGroupManagerFactory.php:41
MediaWiki\User\UserEditTracker
Track info about user edit counts and timings.
Definition: UserEditTracker.php:21
MediaWiki\User\UserGroupManagerFactory\$groupPermissionLookup
GroupPermissionsLookup $groupPermissionLookup
Definition: UserGroupManagerFactory.php:50
MediaWiki\HookContainer\HookContainer
HookContainer class.
Definition: HookContainer.php:45
MediaWiki\User\UserGroupManagerFactory\$hookContainer
HookContainer $hookContainer
Definition: UserGroupManagerFactory.php:59
MediaWiki\User\UserGroupManagerFactory\__construct
__construct(ServiceOptions $options, ConfiguredReadOnlyMode $configuredReadOnlyMode, ILBFactory $dbLoadBalancerFactory, HookContainer $hookContainer, UserEditTracker $userEditTracker, GroupPermissionsLookup $groupPermissionsLookup, LoggerInterface $logger, array $clearCacheCallbacks=[])
Definition: UserGroupManagerFactory.php:71
Wikimedia\Rdbms\ILBFactory
An interface for generating database load balancers.
Definition: ILBFactory.php:33
MediaWiki\User\UserGroupManagerFactory\getUserGroupManager
getUserGroupManager( $dbDomain=false)
Definition: UserGroupManagerFactory.php:95
MediaWiki\User\UserGroupManagerFactory\$userEditTracker
UserEditTracker $userEditTracker
Definition: UserGroupManagerFactory.php:47