MediaWiki master
UserRequirementsConditionCheckerFactory.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\User;
8
14use Psr\Log\LoggerInterface;
15
20
22 private $instances = [];
23
24 public function __construct(
25 private readonly ServiceOptions $options,
26 private readonly GroupPermissionsLookup $groupPermissionsLookup,
27 private readonly HookContainer $hookContainer,
28 private readonly LoggerInterface $logger,
29 private readonly UserEditTracker $userEditTracker,
30 private readonly UserRegistrationLookup $userRegistrationLookup,
31 private readonly UserFactory $userFactory,
32 private readonly IContextSource $context,
33 ) {
34 }
35
42 UserGroupManager $userGroupManager,
43 $wikiId = UserIdentity::LOCAL
45 $key = (string)$wikiId;
46 if ( !isset( $this->instances[$key] ) ) {
47 $this->instances[$key] = new UserRequirementsConditionChecker(
48 $this->options,
49 $this->groupPermissionsLookup,
50 $this->hookContainer,
51 $this->logger,
52 $this->userEditTracker,
53 $this->userRegistrationLookup,
54 $this->userFactory,
55 $this->context,
56 $userGroupManager,
57 $wikiId,
58 );
59 }
60
61 return $this->instances[$key];
62 }
63}
A class for passing options to services.
Track info about user edit counts and timings.
Create User objects.
Manage user group memberships.
getUserRequirementsConditionChecker(UserGroupManager $userGroupManager, $wikiId=UserIdentity::LOCAL)
__construct(private readonly ServiceOptions $options, private readonly GroupPermissionsLookup $groupPermissionsLookup, private readonly HookContainer $hookContainer, private readonly LoggerInterface $logger, private readonly UserEditTracker $userEditTracker, private readonly UserRegistrationLookup $userRegistrationLookup, private readonly UserFactory $userFactory, private readonly IContextSource $context,)
Interface for objects which can provide a MediaWiki context on request.
const LOCAL
Wiki ID value to use with instances that are defined relative to the local wiki.