MediaWiki REL1_35
|
This class provides an implementation of the hook interfaces used by the core Action API, forwarding hook calls to HookContainer for dispatch to extensions. More...
Public Member Functions | |
__construct (HookContainer $container) | |
onAPIAfterExecute ( $module) | |
This hook is called after calling the execute() method of an API module. | |
onApiCheckCanExecute ( $module, $user, &$message) | |
This hook is called during ApiMain::checkCanExecute. | |
onApiDeprecationHelp (&$msgs) | |
Use this hook to add messages to the 'deprecation-help' warning generated from ApiBase::addDeprecation(). | |
onApiFeedContributions__feedItem ( $row, $context, &$feedItem) | |
Use this hook to convert the result of ContribsPager into a FeedItem instance that ApiFeedContributions can consume. | |
onApiFormatHighlight ( $context, $text, $mime, $format) | |
Use this hook to syntax-highlight API pretty-printed output. | |
onAPIGetAllowedParams ( $module, &$params, $flags) | |
Use this hook to modify a module's parameters. | |
onAPIGetDescriptionMessages ( $module, &$msg) | |
Use this hook to modify a module's help message. | |
onAPIGetParamDescriptionMessages ( $module, &$msg) | |
Use this hook to modify a module's parameter descriptions. | |
onAPIHelpModifyOutput ( $module, &$help, $options, &$tocData) | |
Use this hook to modify an API module's help output. | |
onApiMain__moduleManager ( $moduleManager) | |
This hook is called when ApiMain has finished initializing its module manager. | |
onApiMain__onException ( $apiMain, $e) | |
This hook is called by ApiMain::executeActionWithErrorHandling() when an exception is thrown during API action execution. | |
onApiMakeParserOptions ( $options, $title, $params, $module, &$reset, &$suppressCache) | |
This hook is called from ApiParse and ApiExpandTemplates to allow extensions to adjust the ParserOptions before parsing. | |
onApiMaxLagInfo (&$lagInfo) | |
This hook is called when lag information is being requested via API. | |
onApiOpenSearchSuggest (&$results) | |
This hook is called when constructing the OpenSearch results. | |
onApiOptions ( $apiModule, $user, $changes, $resetKinds) | |
This hook is called by action=options before applying changes to user preferences. | |
onApiParseMakeOutputPage ( $module, $output) | |
This hook is called when preparing the OutputPage object for ApiParse. | |
onApiQuery__moduleManager ( $moduleManager) | |
This hook is called when ApiQuery has finished initializing its module manager. | |
onAPIQueryAfterExecute ( $module) | |
This hook is called after calling the execute() method of an action=query submodule. | |
onApiQueryBaseAfterQuery ( $module, $result, &$hookData) | |
This hook is called for (some) API query modules after the database query has returned. | |
onApiQueryBaseBeforeQuery ( $module, &$tables, &$fields, &$conds, &$query_options, &$join_conds, &$hookData) | |
This hook is called for (some) API query modules before a database query is made. | |
onApiQueryBaseProcessRow ( $module, $row, &$data, &$hookData) | |
This hook is called for (some) API query modules as each row of the database result is processed. | |
onAPIQueryGeneratorAfterExecute ( $module, $resultPageSet) | |
This hook is called after calling the executeGenerator() method of an action=query submodule. | |
onAPIQueryInfoTokens (&$tokenFunctions) | |
Use this hook to add custom tokens to prop=info. | |
onAPIQueryRecentChangesTokens (&$tokenFunctions) | |
Use this hook to add custom tokens to list=recentchanges. | |
onAPIQueryRevisionsTokens (&$tokenFunctions) | |
Use this hook to add custom tokens to prop=revisions. | |
onAPIQuerySiteInfoGeneralInfo ( $module, &$results) | |
Use this hook to add extra information to the site's general information. | |
onAPIQuerySiteInfoStatisticsInfo (&$results) | |
Use this hook to add extra information to the site's statistics information. | |
onApiQueryTokensRegisterTypes (&$salts) | |
Use this hook to add additional token types to action=query&meta=tokens. | |
onAPIQueryUsersTokens (&$tokenFunctions) | |
Use this hook to add custom token to list=users. | |
onApiQueryWatchlistExtractOutputData ( $module, $watchedItem, $recentChangeInfo, &$vals) | |
Use this hook to extract row data for ApiQueryWatchlist. | |
onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions ( $module, $params, &$options) | |
Use this hook to populate the options to be passed from ApiQueryWatchlist to WatchedItemQueryService. | |
onApiRsdServiceApis (&$apis) | |
Use this hook to add or remove APIs from the RSD services list. | |
onApiTokensGetTokenTypes (&$tokenTypes) | |
Use this hook to extend action=tokens with new token types. | |
onApiValidatePassword ( $module, &$r) | |
This hook is called from ApiValidatePassword. | |
onChangeAuthenticationDataAudit ( $req, $status) | |
This hook is called when a user changes their password. | |
onEditFormPreloadText (&$text, $title) | |
Use this hook to populate the edit form when creating pages. | |
onFileUndeleteComplete ( $title, $fileVersions, $user, $reason) | |
This hook is called when a file is undeleted. | |
onImportSources (&$importSources) | |
This hook is called when reading from the $wgImportSources configuration variable. | |
onLanguageLinks ( $title, &$links, &$linkFlags) | |
Use this hook to manipulate a page's language links. | |
onOutputPageCheckLastModified (&$modifiedTimes, $out) | |
This hook is called when checking if the page has been modified since the last visit. | |
onRequestHasSameOriginSecurity ( $request) | |
Use this hook to determine if the request is somehow flagged to lack same-origin security. | |
onUserLoginComplete ( $user, &$inject_html, $direct) | |
Use this hook to show custom content after a user has logged in via the web interface. | |
onUserLogoutComplete ( $user, &$inject_html, $oldName) | |
This hook is called after a user has logged out. | |
Private Attributes | |
HookContainer | $container |
This class provides an implementation of the hook interfaces used by the core Action API, forwarding hook calls to HookContainer for dispatch to extensions.
To get an instance, use ApiBase::getHookRunner().
Definition at line 14 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::__construct | ( | HookContainer | $container | ) |
Definition at line 62 of file ApiHookRunner.php.
References MediaWiki\Api\ApiHookRunner\$container.
MediaWiki\Api\ApiHookRunner::onAPIAfterExecute | ( | $module | ) |
This hook is called after calling the execute() method of an API module.
Use this hook to extend core API modules.
ApiBase | $module | Module object |
Implements MediaWiki\Api\Hook\APIAfterExecuteHook.
Definition at line 66 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiCheckCanExecute | ( | $module, | |
$user, | |||
& | $message | ||
) |
This hook is called during ApiMain::checkCanExecute.
Use this hook to further authenticate and authorize API clients before executing the module.
ApiBase | $module | Module object |
User | $user | Current user |
IApiMessage | Message | string | array | &$message | API message to die with. Specific values accepted depend on the MediaWiki version:
|
Implements MediaWiki\Api\Hook\ApiCheckCanExecuteHook.
Definition at line 73 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiDeprecationHelp | ( | & | $msgs | ) |
Use this hook to add messages to the 'deprecation-help' warning generated from ApiBase::addDeprecation().
Message[] | &$msgs | Messages to include in the help. Multiple messages will be joined with spaces. |
Implements MediaWiki\Api\Hook\ApiDeprecationHelpHook.
Definition at line 80 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiFeedContributions__feedItem | ( | $row, | |
$context, | |||
& | $feedItem | ||
) |
Use this hook to convert the result of ContribsPager into a FeedItem instance that ApiFeedContributions can consume.
Implementors of this hook may cancel the hook to signal that the item is not viewable in the provided context.
stdClass | $row | A row of data from ContribsPager. The set of data returned by ContribsPager can be adjusted by handling the ContribsPager::reallyDoQuery hook. |
IContextSource | $context | |
FeedItem | null | &$feedItem | Set this to a FeedItem instance if the callback can handle the provided row. This is provided to the hook as a null, if it is non-null then another callback has already handled the hook. |
Implements MediaWiki\Api\Hook\ApiFeedContributions__feedItemHook.
Definition at line 87 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiFormatHighlight | ( | $context, | |
$text, | |||
$mime, | |||
$format | |||
) |
Use this hook to syntax-highlight API pretty-printed output.
IContextSource | $context | |
string | $text | Text to be highlighted |
string | $mime | MIME type of $text |
string | $format | API format code for $text |
Implements MediaWiki\Api\Hook\ApiFormatHighlightHook.
Definition at line 94 of file ApiHookRunner.php.
References $mime.
MediaWiki\Api\ApiHookRunner::onAPIGetAllowedParams | ( | $module, | |
& | $params, | ||
$flags | |||
) |
Use this hook to modify a module's parameters.
ApiBase | $module | Module object |
array | &$params | Array of parameters |
int | $flags | Zero or OR-ed flags like ApiBase::GET_VALUES_FOR_HELP |
Implements MediaWiki\Api\Hook\APIGetAllowedParamsHook.
Definition at line 101 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIGetDescriptionMessages | ( | $module, | |
& | $msg | ||
) |
Use this hook to modify a module's help message.
Implements MediaWiki\Api\Hook\APIGetDescriptionMessagesHook.
Definition at line 108 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIGetParamDescriptionMessages | ( | $module, | |
& | $msg | ||
) |
Use this hook to modify a module's parameter descriptions.
Implements MediaWiki\Api\Hook\APIGetParamDescriptionMessagesHook.
Definition at line 115 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIHelpModifyOutput | ( | $module, | |
& | $help, | ||
$options, | |||
& | $tocData | ||
) |
Use this hook to modify an API module's help output.
ApiBase | $module | Module object |
string[] | &$help | Array of HTML strings to be joined for the output |
array | $options | Array of formatting options passed to ApiHelp::getHelp |
array | &$tocData | If a TOC is being generated, this array has keys as anchors in the page and values as for Linker::generateTOC(). |
Implements MediaWiki\Api\Hook\APIHelpModifyOutputHook.
Definition at line 122 of file ApiHookRunner.php.
References $help.
MediaWiki\Api\ApiHookRunner::onApiMain__moduleManager | ( | $moduleManager | ) |
This hook is called when ApiMain has finished initializing its module manager.
Use this hook to conditionally register API modules.
ApiModuleManager | $moduleManager |
Implements MediaWiki\Api\Hook\ApiMain__moduleManagerHook.
Definition at line 129 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiMain__onException | ( | $apiMain, | |
$e | |||
) |
This hook is called by ApiMain::executeActionWithErrorHandling() when an exception is thrown during API action execution.
Implements MediaWiki\Api\Hook\ApiMain__onExceptionHook.
Definition at line 136 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiMakeParserOptions | ( | $options, | |
$title, | |||
$params, | |||
$module, | |||
& | $reset, | ||
& | $suppressCache | ||
) |
This hook is called from ApiParse and ApiExpandTemplates to allow extensions to adjust the ParserOptions before parsing.
ParserOptions | $options | |
Title | $title | Title to be parsed |
array | $params | Parameter array for the API module |
ApiBase | $module | API module (which is also a ContextSource) |
ScopedCallback | null | &$reset | Set to a ScopedCallback used to reset any hooks after the parse is done |
bool | &$suppressCache | Set true if cache should be suppressed |
Implements MediaWiki\Api\Hook\ApiMakeParserOptionsHook.
Definition at line 143 of file ApiHookRunner.php.
References $title.
MediaWiki\Api\ApiHookRunner::onApiMaxLagInfo | ( | & | $lagInfo | ) |
This hook is called when lag information is being requested via API.
Use this hook to override lag information. Generally a hook function should only replace $lagInfo if the new $lagInfo['lag'] is greater than the current $lagInfo['lag'].
array | &$lagInfo | Maximum lag information array. Fields in the array are:
|
You can also add more fields that are returned to the user in the API response.
Implements MediaWiki\Api\Hook\ApiMaxLagInfoHook.
Definition at line 152 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiOpenSearchSuggest | ( | & | $results | ) |
This hook is called when constructing the OpenSearch results.
Hooks can alter or append to the array.
array[] | &$results | Array with integer keys to associative arrays. Keys in associative array:
|
Implements MediaWiki\Api\Hook\ApiOpenSearchSuggestHook.
Definition at line 160 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiOptions | ( | $apiModule, | |
$user, | |||
$changes, | |||
$resetKinds | |||
) |
This hook is called by action=options before applying changes to user preferences.
ApiOptions | $apiModule | Calling ApiOptions object |
User | $user | User object whose preferences are being changed |
array | $changes | Associative array of preference name => value |
string[] | $resetKinds | Array of strings specifying which options kinds to reset See User::resetOptions() and User::getOptionKinds() for possible values. |
Implements MediaWiki\Api\Hook\ApiOptionsHook.
Definition at line 167 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiParseMakeOutputPage | ( | $module, | |
$output | |||
) |
This hook is called when preparing the OutputPage object for ApiParse.
This is mainly intended for calling OutputPage::addContentOverride() or OutputPage::addContentOverrideCallback().
ApiBase | $module | ApiBase (which is also a ContextSource) |
OutputPage | $output |
Implements MediaWiki\Api\Hook\ApiParseMakeOutputPageHook.
Definition at line 174 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQuery__moduleManager | ( | $moduleManager | ) |
This hook is called when ApiQuery has finished initializing its module manager.
Use this hook to conditionally register API query modules.
ApiModuleManager | $moduleManager |
Implements MediaWiki\Api\Hook\ApiQuery__moduleManagerHook.
Definition at line 286 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQueryAfterExecute | ( | $module | ) |
This hook is called after calling the execute() method of an action=query submodule.
Use this hook to extend core API modules.
ApiBase | $module | Module object |
Implements MediaWiki\Api\Hook\APIQueryAfterExecuteHook.
Definition at line 181 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryBaseAfterQuery | ( | $module, | |
$result, | |||
& | $hookData | ||
) |
This hook is called for (some) API query modules after the database query has returned.
An API query module wanting to use this hook should see the ApiQueryBase::select() and ApiQueryBase::processRow() documentation.
ApiQueryBase | $module | Module in question |
IResultWrapper | bool | $result | ResultWrapper or bool returned from the IDatabase::select() |
array | &$hookData | Array that was passed to the ApiQueryBaseBeforeQuery hook and will be passed to the ApiQueryBaseProcessRow hook, intended for inter-hook communication |
Implements MediaWiki\Api\Hook\ApiQueryBaseAfterQueryHook.
Definition at line 188 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryBaseBeforeQuery | ( | $module, | |
& | $tables, | ||
& | $fields, | ||
& | $conds, | ||
& | $query_options, | ||
& | $join_conds, | ||
& | $hookData | ||
) |
This hook is called for (some) API query modules before a database query is made.
WARNING: It would be very easy to misuse this hook and break the module! Any joins added must join on a unique key of the target table unless you really know what you're doing. An API query module wanting to use this hook should see the ApiQueryBase::select() and ApiQueryBase::processRow() documentation.
ApiQueryBase | $module | Module in question |
array | &$tables | Array of tables to be queried |
array | &$fields | Array of columns to select |
array | &$conds | Array of WHERE conditionals for query |
array | &$query_options | Array of options for the database request |
array | &$join_conds | Join conditions for the tables |
array | &$hookData | Array that will be passed to the ApiQueryBaseAfterQuery and ApiQueryBaseProcessRow hooks, intended for inter-hook communication. |
Implements MediaWiki\Api\Hook\ApiQueryBaseBeforeQueryHook.
Definition at line 195 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryBaseProcessRow | ( | $module, | |
$row, | |||
& | $data, | ||
& | $hookData | ||
) |
This hook is called for (some) API query modules as each row of the database result is processed.
An API query module wanting to use this hook should see the ApiQueryBase::select() and ApiQueryBase::processRow() documentation.
ApiQueryBase | $module | Module in question |
stdClass | $row | Database result row |
array | &$data | Array to be included in the ApiResult |
array | &$hookData | Array that was be passed to the ApiQueryBaseBeforeQuery and ApiQueryBaseAfterQuery hooks, intended for inter-hook communication |
Implements MediaWiki\Api\Hook\ApiQueryBaseProcessRowHook.
Definition at line 205 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQueryGeneratorAfterExecute | ( | $module, | |
$resultPageSet | |||
) |
This hook is called after calling the executeGenerator() method of an action=query submodule.
Use this hook to extend core API modules.
ApiBase | $module | Module object |
ApiPageSet | $resultPageSet |
Implements MediaWiki\Api\Hook\APIQueryGeneratorAfterExecuteHook.
Definition at line 212 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQueryInfoTokens | ( | & | $tokenFunctions | ) |
Use this hook to add custom tokens to prop=info.
Every token has an action, which will be used in the intoken parameter and in the output (actiontoken="..."), and a callback function which should return the token, or false if the user isn't allowed to obtain it. The prototype of the callback function is func($pageid, $title), where $pageid is the page ID of the page the token is requested for and $title is the associated Title object. In the hook, add your callback to the $tokenFunctions array and return true (returning false makes no sense).
array | &$tokenFunctions | [ action => callback ] |
Implements MediaWiki\Api\Hook\APIQueryInfoTokensHook.
Definition at line 219 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQueryRecentChangesTokens | ( | & | $tokenFunctions | ) |
Use this hook to add custom tokens to list=recentchanges.
Every token has an action, which will be used in the rctoken parameter and in the output (actiontoken="..."), and a callback function which should return the token, or false if the user isn't allowed to obtain it. The prototype of the callback function is func($pageid, $title, $rc), where $pageid is the page ID of the page associated to the revision the token is requested for, $title the associated Title object and $rc the associated RecentChange object. In the hook, add your callback to the $tokenFunctions array and return true (returning false makes no sense).
array | &$tokenFunctions | [ action => callback ] |
Implements MediaWiki\Api\Hook\APIQueryRecentChangesTokensHook.
Definition at line 226 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQueryRevisionsTokens | ( | & | $tokenFunctions | ) |
Use this hook to add custom tokens to prop=revisions.
Every token has an action, which will be used in the rvtoken parameter and in the output (actiontoken="..."), and a callback function which should return the token, or false if the user isn't allowed to obtain it. The prototype of the callback function is func($pageid, $title, $rev), where $pageid is the page ID of the page associated to the revision the token is requested for, $title the associated Title object and $rev the associated Revision object. In the hook, add your callback to the $tokenFunctions array and return true (returning false makes no sense).
array | &$tokenFunctions | [ action => callback ] |
Implements MediaWiki\Api\Hook\APIQueryRevisionsTokensHook.
Definition at line 233 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQuerySiteInfoGeneralInfo | ( | $module, | |
& | $results | ||
) |
Use this hook to add extra information to the site's general information.
ApiQuerySiteinfo | $module | Current ApiQuerySiteinfo module |
array | &$results | Array of results, add things here |
Implements MediaWiki\Api\Hook\APIQuerySiteInfoGeneralInfoHook.
Definition at line 240 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQuerySiteInfoStatisticsInfo | ( | & | $results | ) |
Use this hook to add extra information to the site's statistics information.
array | &$results | Array of results, add things here |
Implements MediaWiki\Api\Hook\APIQuerySiteInfoStatisticsInfoHook.
Definition at line 247 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryTokensRegisterTypes | ( | & | $salts | ) |
Use this hook to add additional token types to action=query&meta=tokens.
Note that most modules will probably be able to use the CSRF token instead of creating their own token types.
array | &$salts | [ type => salt to pass to User::getEditToken(), or array of salt and key to pass to Session::getToken() ] |
Implements MediaWiki\Api\Hook\ApiQueryTokensRegisterTypesHook.
Definition at line 254 of file ApiHookRunner.php.
Referenced by ApiQueryTokens\getTokenTypeSalts().
MediaWiki\Api\ApiHookRunner::onAPIQueryUsersTokens | ( | & | $tokenFunctions | ) |
Use this hook to add custom token to list=users.
Every token has an action, which will be used in the ustoken parameter and in the output (actiontoken="..."), and a callback function which should return the token, or false if the user isn't allowed to obtain it. The prototype of the callback function is func($user) where $user is the User object. In the hook, add your callback to the $tokenFunctions array and return true (returning false makes no sense).
array | &$tokenFunctions | [ action => callback ] |
Implements MediaWiki\Api\Hook\APIQueryUsersTokensHook.
Definition at line 261 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryWatchlistExtractOutputData | ( | $module, | |
$watchedItem, | |||
$recentChangeInfo, | |||
& | $vals | ||
) |
Use this hook to extract row data for ApiQueryWatchlist.
ApiQueryWatchlist | $module | |
WatchedItem | $watchedItem | |
array | $recentChangeInfo | Array of recent change info data |
array | &$vals | Associative array of data to be output for the row |
Implements MediaWiki\Api\Hook\ApiQueryWatchlistExtractOutputDataHook.
Definition at line 268 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions | ( | $module, | |
$params, | |||
& | $options | ||
) |
Use this hook to populate the options to be passed from ApiQueryWatchlist to WatchedItemQueryService.
ApiQueryWatchlist | $module | |
array | $params | Array of parameters, as would be returned by $module->extractRequestParams() |
array | &$options | Array of options for WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo() |
Implements MediaWiki\Api\Hook\ApiQueryWatchlistPrepareWatchedItemQueryServiceOptionsHook.
Definition at line 277 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiRsdServiceApis | ( | & | $apis | ) |
Use this hook to add or remove APIs from the RSD services list.
Each service should have its own entry in the $apis array and have a unique name, passed as key for the array that represents the service data. In this data array, the key-value-pair identified by the apiLink key is required.
array | &$apis | Array of services |
Implements MediaWiki\Api\Hook\ApiRsdServiceApisHook.
Definition at line 293 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiTokensGetTokenTypes | ( | & | $tokenTypes | ) |
Use this hook to extend action=tokens with new token types.
array | &$tokenTypes | Supported token types in format 'type' => callback function used to retrieve this type of token |
Implements MediaWiki\Api\Hook\ApiTokensGetTokenTypesHook.
Definition at line 300 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiValidatePassword | ( | $module, | |
& | $r | ||
) |
This hook is called from ApiValidatePassword.
ApiValidatePassword | $module | |
array | &$r | Result array |
Implements MediaWiki\Api\Hook\ApiValidatePasswordHook.
Definition at line 307 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onChangeAuthenticationDataAudit | ( | $req, | |
$status | |||
) |
This hook is called when a user changes their password.
No return data is accepted; this hook is for auditing only.
AuthenticationRequest | $req | AuthenticationRequest object describing the change (and target user) |
StatusValue | $status | StatusValue with the result of the action |
Implements MediaWiki\SpecialPage\Hook\ChangeAuthenticationDataAuditHook.
Definition at line 314 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onEditFormPreloadText | ( | & | $text, |
$title | |||
) |
Use this hook to populate the edit form when creating pages.
Implements MediaWiki\Hook\EditFormPreloadTextHook.
Definition at line 321 of file ApiHookRunner.php.
References $title.
MediaWiki\Api\ApiHookRunner::onFileUndeleteComplete | ( | $title, | |
$fileVersions, | |||
$user, | |||
$reason | |||
) |
This hook is called when a file is undeleted.
Title | $title | Title object for the file |
int[] | $fileVersions | Array of undeleted filearchive IDs. Empty if all versions were restored. |
User | $user | User who performed the undeletion |
string | $reason |
Implements MediaWiki\Hook\FileUndeleteCompleteHook.
Definition at line 328 of file ApiHookRunner.php.
References $title.
MediaWiki\Api\ApiHookRunner::onImportSources | ( | & | $importSources | ) |
This hook is called when reading from the $wgImportSources configuration variable.
This can be used to lazy-load the import sources list.
array | &$importSources | The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. |
Implements MediaWiki\Hook\ImportSourcesHook.
Definition at line 335 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onLanguageLinks | ( | $title, | |
& | $links, | ||
& | $linkFlags | ||
) |
Use this hook to manipulate a page's language links.
This hook is called in various places to allow extensions to define the effective language links for a page.
Title | $title | |
string[] | &$links | Array with elements of the form "language:title" in the order that they will be output |
array | &$linkFlags | Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. |
Implements MediaWiki\Hook\LanguageLinksHook.
Definition at line 342 of file ApiHookRunner.php.
References $title.
MediaWiki\Api\ApiHookRunner::onOutputPageCheckLastModified | ( | & | $modifiedTimes, |
$out | |||
) |
This hook is called when checking if the page has been modified since the last visit.
string[] | &$modifiedTimes | Array of timestamps. The following keys are set: page, user, epoch. |
OutputPage | $out | since 1.28 |
Implements MediaWiki\Hook\OutputPageCheckLastModifiedHook.
Definition at line 349 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onRequestHasSameOriginSecurity | ( | $request | ) |
Use this hook to determine if the request is somehow flagged to lack same-origin security.
Note that if the "somehow" involves HTTP headers, you'll probably need to make sure the header is varied on.
WebRequest | $request |
Implements MediaWiki\Api\Hook\RequestHasSameOriginSecurityHook.
Definition at line 356 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onUserLoginComplete | ( | $user, | |
& | $inject_html, | ||
$direct | |||
) |
Use this hook to show custom content after a user has logged in via the web interface.
For functionality that needs to run after any login (API or web) use UserLoggedIn.
User | $user | The user object that was created on login |
string | &$inject_html | Any HTML to inject after the "logged in" message. |
bool | $direct | (bool) The hook is called directly after a successful login. This will only happen once per login. A UserLoginComplete call with direct=false can happen when the user visits the login page while already logged in. |
Implements MediaWiki\Hook\UserLoginCompleteHook.
Definition at line 363 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onUserLogoutComplete | ( | $user, | |
& | $inject_html, | ||
$oldName | |||
) |
This hook is called after a user has logged out.
User | $user | the user object after logout (won't have name, ID, etc.) |
string | &$inject_html | Any HTML to inject after the "logged out" message. |
string | $oldName | name of the user before logout (string) |
Implements MediaWiki\Hook\UserLogoutCompleteHook.
Definition at line 370 of file ApiHookRunner.php.
|
private |
Definition at line 60 of file ApiHookRunner.php.
Referenced by MediaWiki\Api\ApiHookRunner\__construct().