MediaWiki  1.28.1
Go to the documentation of this file.
1 <?php
22 namespace MediaWiki\Auth;
35  public $required = self::OPTIONAL;
41  public $maybeLink = [];
49  public function __construct(
51  ) {
52  $this->createRequest = $createRequest;
53  $this->maybeLink = $maybeLink;
54  $this->username = $createRequest ? $createRequest->username : null;
55  }
57  public function getFieldInfo() {
58  return [];
59  }
61  public function loadFromSubmission( array $data ) {
62  return true;
63  }
71  public function hasStateForAction( $action ) {
72  switch ( $action ) {
74  return (bool)$this->maybeLink;
76  return $this->maybeLink || $this->createRequest;
77  default:
78  return false;
79  }
80  }
88  public function hasPrimaryStateForAction( $action ) {
89  switch ( $action ) {
91  return (bool)$this->createRequest;
92  default:
93  return false;
94  }
95  }
96 }
This transfers state between the login and account creation flows.
the array() calling protocol came about after MediaWiki 1.4rc1.
Indicate whether this request contains any state for the specified action.
__construct(AuthenticationRequest $createRequest=null, array $maybeLink=[])
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
Indicate whether this request contains state for the specified action sufficient to replace other pri...
Create a new user.
Definition: AuthManager.php:88
Log in with an existing (not necessarily local) user.
Definition: AuthManager.php:83
string null $action
The AuthManager::ACTION_* constant this request was created to be used for.
This is a value object for authentication requests.