MediaWiki  master
AbstractAuthenticationProvider.php
Go to the documentation of this file.
1 <?php
22 namespace MediaWiki\Auth;
23 
24 use Config;
28 use Psr\Log\LoggerInterface;
29 
38  protected $logger;
39 
41  protected $manager;
42 
44  protected $config;
45 
47  private $hookContainer;
48 
50  private $hookRunner;
51 
53  protected $userNameUtils;
54 
69  public function init(
70  LoggerInterface $logger,
75  ) {
76  $this->logger = $logger;
77  $this->manager = $manager;
78  $this->hookContainer = $hookContainer;
79  $this->hookRunner = new HookRunner( $hookContainer );
80  $this->config = $config;
81  $this->userNameUtils = $userNameUtils;
82  $this->postInitSetup();
83  }
84 
92  protected function postInitSetup() {
93  }
94 
103  public function setLogger( LoggerInterface $logger ) {
104  wfDeprecated( __METHOD__, '1.37' );
105  $this->logger = $logger;
106  }
107 
116  public function setManager( AuthManager $manager ) {
117  wfDeprecated( __METHOD__, '1.37' );
118  $this->manager = $manager;
119  }
120 
130  public function setConfig( Config $config ) {
131  wfDeprecated( __METHOD__, '1.37' );
132  $this->config = $config;
133  }
134 
144  wfDeprecated( __METHOD__, '1.37' );
145  $this->hookContainer = $hookContainer;
146  $this->hookRunner = new HookRunner( $hookContainer );
147  }
148 
153  public function getUniqueId() {
154  return static::class;
155  }
156 
161  protected function getHookContainer(): HookContainer {
162  return $this->hookContainer;
163  }
164 
171  protected function getHookRunner(): HookRunner {
172  return $this->hookRunner;
173  }
174 }
MediaWiki\Auth\AbstractAuthenticationProvider\getUniqueId
getUniqueId()
Return a unique identifier for this instance.This must be the same across requests....
Definition: AbstractAuthenticationProvider.php:153
MediaWiki\Auth\AbstractAuthenticationProvider\$hookContainer
HookContainer $hookContainer
Definition: AbstractAuthenticationProvider.php:47
MediaWiki\Auth\AbstractAuthenticationProvider\$manager
AuthManager $manager
Definition: AbstractAuthenticationProvider.php:41
MediaWiki\Auth\AbstractAuthenticationProvider\$hookRunner
HookRunner $hookRunner
Definition: AbstractAuthenticationProvider.php:50
Config
Interface for configuration instances.
Definition: Config.php:30
MediaWiki\Auth\AbstractAuthenticationProvider\setHookContainer
setHookContainer(HookContainer $hookContainer)
Definition: AbstractAuthenticationProvider.php:143
MediaWiki\Auth\AbstractAuthenticationProvider\setManager
setManager(AuthManager $manager)
Definition: AbstractAuthenticationProvider.php:116
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:996
MediaWiki\Auth\AbstractAuthenticationProvider\$userNameUtils
UserNameUtils $userNameUtils
Definition: AbstractAuthenticationProvider.php:53
MediaWiki\Auth\AbstractAuthenticationProvider\setConfig
setConfig(Config $config)
Definition: AbstractAuthenticationProvider.php:130
MediaWiki\Auth\AbstractAuthenticationProvider\postInitSetup
postInitSetup()
A provider can override this to do any necessary setup after init() is called.
Definition: AbstractAuthenticationProvider.php:92
MediaWiki\Auth\AbstractAuthenticationProvider\setLogger
setLogger(LoggerInterface $logger)
Definition: AbstractAuthenticationProvider.php:103
MediaWiki\Auth\AuthManager
This serves as the entry point to the authentication system.
Definition: AuthManager.php:98
MediaWiki\User\UserNameUtils
UserNameUtils service.
Definition: UserNameUtils.php:42
MediaWiki\Auth\AbstractAuthenticationProvider\$logger
LoggerInterface $logger
Definition: AbstractAuthenticationProvider.php:38
MediaWiki\Auth\AbstractAuthenticationProvider
A base class that implements some of the boilerplate for an AuthenticationProvider.
Definition: AbstractAuthenticationProvider.php:36
MediaWiki\HookContainer\HookContainer
HookContainer class.
Definition: HookContainer.php:45
MediaWiki\Auth\AbstractAuthenticationProvider\init
init(LoggerInterface $logger, AuthManager $manager, HookContainer $hookContainer, Config $config, UserNameUtils $userNameUtils)
Initialise with dependencies of an AuthenticationProvider.
Definition: AbstractAuthenticationProvider.php:69
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Definition: HookRunner.php:555
MediaWiki\Auth
Definition: AbstractAuthenticationProvider.php:22
MediaWiki\Auth\AbstractAuthenticationProvider\getHookContainer
getHookContainer()
Definition: AbstractAuthenticationProvider.php:161
MediaWiki\Auth\AbstractAuthenticationProvider\$config
Config $config
Definition: AbstractAuthenticationProvider.php:44
MediaWiki\Auth\AbstractAuthenticationProvider\getHookRunner
getHookRunner()
Definition: AbstractAuthenticationProvider.php:171
MediaWiki\Auth\AuthenticationProvider
An AuthenticationProvider is used by AuthManager when authenticating users.
Definition: AuthenticationProvider.php:39