|
| __construct (array $actionsConfig, LoggerInterface $logger, ObjectFactory $objectFactory, HookContainer $hookContainer) |
|
| getAction (string $actionName, $article, IContextSource $context) |
| Get an appropriate Action subclass for the given action, taking into account Article-specific overrides.
|
|
| getActionInfo (string $name, $target=null) |
| Returns an object containing information about the given action, or null if the action is not known.
|
|
| getActionName (IContextSource $context) |
| Get the name of the action that will be executed, not necessarily the one passed through the "action" request parameter.
|
|
- Since
- 1.37
- Author
- DannyS712
Definition at line 47 of file ActionFactory.php.
◆ __construct()
MediaWiki\Actions\ActionFactory::__construct |
( |
array | $actionsConfig, |
|
|
LoggerInterface | $logger, |
|
|
ObjectFactory | $objectFactory, |
|
|
HookContainer | $hookContainer ) |
- Parameters
-
array | $actionsConfig | Configured actions (eg those added by extensions to $wgActions) |
LoggerInterface | $logger | |
ObjectFactory | $objectFactory | |
HookContainer | $hookContainer | |
Definition at line 186 of file ActionFactory.php.
◆ getAction()
MediaWiki\Actions\ActionFactory::getAction |
( |
string | $actionName, |
|
|
| $article, |
|
|
IContextSource | $context ) |
Get an appropriate Action subclass for the given action, taking into account Article-specific overrides.
- Parameters
-
string | $actionName | |
Article | PageIdentity | $article | The target on which the action is to be performed. |
IContextSource | $context | |
- Returns
- Action|false|null False if the action is disabled, null if not recognized
Definition at line 227 of file ActionFactory.php.
◆ getActionInfo()
MediaWiki\Actions\ActionFactory::getActionInfo |
( |
string | $name, |
|
|
| $target = null ) |
Returns an object containing information about the given action, or null if the action is not known.
Currently, this will also return null if the action is known but disabled. This may change in the future.
- Note
- If $target refers to a non-proper page (such as a special page), this method will currently return null due to limitations in the way it is implemented (T346036). This will also happen when $target is null if the wiki's main page is not a proper page (e.g. Special:MyLanguage/Main_Page, see T348451).
- Parameters
-
string | $name | |
Article | PageIdentity | null | $target | The target on which the action is to be performed, if known. This is used to apply page-specific action overrides. |
- Returns
- ?ActionInfo
- Since
- 1.41
Definition at line 328 of file ActionFactory.php.
◆ getActionName()
MediaWiki\Actions\ActionFactory::getActionName |
( |
IContextSource | $context | ) |
|
Get the name of the action that will be executed, not necessarily the one passed through the "action" request parameter.
Actions disabled in $wgActions will be replaced by "nosuchaction".
- Parameters
-
- Returns
- string Action name
Definition at line 371 of file ActionFactory.php.
◆ getArticle()
MediaWiki\Actions\ActionFactory::getArticle |
( |
IContextSource | $context | ) |
|
|
protected |
Protected to allow overriding with a partial mock in unit tests.
- Parameters
-
- Returns
- Article
Definition at line 428 of file ActionFactory.php.
The documentation for this class was generated from the following file: