MediaWiki  master
MediaWiki\User\CentralId\CentralIdLookupFactory Class Reference
Collaboration diagram for MediaWiki\User\CentralId\CentralIdLookupFactory:

Public Member Functions

 __construct (ServiceOptions $options, ObjectFactory $objectFactory, UserIdentityLookup $userIdentityLookup)
 
 getDefaultProviderId ()
 Get the ID of the default central ID provider. More...
 
 getLookup (string $providerId=null)
 Get an instance of a CentralIdLookup. More...
 
 getNonLocalLookup (string $providerID=null)
 Returns a CentralIdLookup that is guaranteed to be non-local. More...
 
 getProviderIds ()
 Get the IDs of the registered central ID lookup providers. More...
 

Private Attributes

string $defaultProvider
 
CentralIdLookup[] $instanceCache = []
 
ObjectFactory $objectFactory
 
array $providers
 ObjectFactory specs indexed by provider name. More...
 
UserIdentityLookup $userIdentityLookup
 

Detailed Description

Definition at line 34 of file CentralIdLookupFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\CentralId\CentralIdLookupFactory::__construct ( ServiceOptions  $options,
ObjectFactory  $objectFactory,
UserIdentityLookup  $userIdentityLookup 
)

Member Function Documentation

◆ getDefaultProviderId()

MediaWiki\User\CentralId\CentralIdLookupFactory::getDefaultProviderId ( )

Get the ID of the default central ID provider.

Returns
string

Definition at line 91 of file CentralIdLookupFactory.php.

References MediaWiki\User\CentralId\CentralIdLookupFactory\$defaultProvider.

◆ getLookup()

MediaWiki\User\CentralId\CentralIdLookupFactory::getLookup ( string  $providerId = null)

Get an instance of a CentralIdLookup.

Parameters
string | null$providerIdProvider ID from $wgCentralIdLookupProviders or null to use the provider configured in $wgCentralIdLookupProvider
Returns
CentralIdLookup
Exceptions
InvalidArgumentExceptionif $providerId is not properly configured

Definition at line 103 of file CentralIdLookupFactory.php.

References MediaWiki\User\CentralId\CentralIdLookupFactory\$defaultProvider.

Referenced by MediaWiki\User\CentralId\CentralIdLookupFactory\getNonLocalLookup().

◆ getNonLocalLookup()

MediaWiki\User\CentralId\CentralIdLookupFactory::getNonLocalLookup ( string  $providerID = null)

Returns a CentralIdLookup that is guaranteed to be non-local.

If no such guarantee can be made, returns null.

If this function returns a non-null CentralIdLookup, that lookup is expected to provide IDs that are shared with some set of other wikis. However, you should still be cautious when using those IDs, as they will not necessarily work with all other wikis, and it can be hard to tell if another wiki is in the same set as this one or not.

Parameters
string | null$providerIDProvider ID from $wgCentralIdLookupProviders or null to use the provider configured in $wgCentralIdLookupProvider
Returns
?CentralIdLookup
Exceptions
InvalidArgumentExceptionif $providerId is not properly configured

Definition at line 135 of file CentralIdLookupFactory.php.

References MediaWiki\User\CentralId\CentralIdLookupFactory\getLookup().

◆ getProviderIds()

MediaWiki\User\CentralId\CentralIdLookupFactory::getProviderIds ( )

Get the IDs of the registered central ID lookup providers.

Returns
string[]

Definition at line 82 of file CentralIdLookupFactory.php.

Member Data Documentation

◆ $defaultProvider

string MediaWiki\User\CentralId\CentralIdLookupFactory::$defaultProvider
private

◆ $instanceCache

CentralIdLookup [] MediaWiki\User\CentralId\CentralIdLookupFactory::$instanceCache = []
private

Definition at line 58 of file CentralIdLookupFactory.php.

◆ $objectFactory

ObjectFactory MediaWiki\User\CentralId\CentralIdLookupFactory::$objectFactory
private

◆ $providers

array MediaWiki\User\CentralId\CentralIdLookupFactory::$providers
private
Initial value:
=[,,]
public const CONSTRUCTOR_OPTIONS
'CentralIdLookupProviders'
'CentralIdLookupProvider'

ObjectFactory specs indexed by provider name.

Definition at line 46 of file CentralIdLookupFactory.php.

◆ $userIdentityLookup

UserIdentityLookup MediaWiki\User\CentralId\CentralIdLookupFactory::$userIdentityLookup
private

The documentation for this class was generated from the following file: