MediaWiki REL1_40
ApiHookRunner.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Api;
4
6
14class ApiHookRunner implements
55{
57 private $container;
58
59 public function __construct( HookContainer $container ) {
60 $this->container = $container;
61 }
62
63 public function onAPIAfterExecute( $module ) {
64 return $this->container->run(
65 'APIAfterExecute',
66 [ $module ]
67 );
68 }
69
70 public function onApiCheckCanExecute( $module, $user, &$message ) {
71 return $this->container->run(
72 'ApiCheckCanExecute',
73 [ $module, $user, &$message ]
74 );
75 }
76
77 public function onApiDeprecationHelp( &$msgs ) {
78 return $this->container->run(
79 'ApiDeprecationHelp',
80 [ &$msgs ]
81 );
82 }
83
84 public function onApiFeedContributions__feedItem( $row, $context, &$feedItem ) {
85 return $this->container->run(
86 'ApiFeedContributions::feedItem',
87 [ $row, $context, &$feedItem ]
88 );
89 }
90
91 public function onApiFormatHighlight( $context, $text, $mime, $format ) {
92 return $this->container->run(
93 'ApiFormatHighlight',
94 [ $context, $text, $mime, $format ]
95 );
96 }
97
98 public function onAPIGetAllowedParams( $module, &$params, $flags ) {
99 return $this->container->run(
100 'APIGetAllowedParams',
101 [ $module, &$params, $flags ]
102 );
103 }
104
105 public function onAPIGetDescriptionMessages( $module, &$msg ) {
106 return $this->container->run(
107 'APIGetDescriptionMessages',
108 [ $module, &$msg ]
109 );
110 }
111
112 public function onAPIGetParamDescriptionMessages( $module, &$msg ) {
113 return $this->container->run(
114 'APIGetParamDescriptionMessages',
115 [ $module, &$msg ]
116 );
117 }
118
119 public function onAPIHelpModifyOutput( $module, &$help, $options, &$tocData ) {
120 return $this->container->run(
121 'APIHelpModifyOutput',
122 [ $module, &$help, $options, &$tocData ]
123 );
124 }
125
126 public function onApiMain__moduleManager( $moduleManager ) {
127 return $this->container->run(
128 'ApiMain::moduleManager',
129 [ $moduleManager ]
130 );
131 }
132
133 public function onApiMain__onException( $apiMain, $e ) {
134 return $this->container->run(
135 'ApiMain::onException',
136 [ $apiMain, $e ]
137 );
138 }
139
140 public function onApiMakeParserOptions( $options, $title, $params, $module,
141 &$reset, &$suppressCache
142 ) {
143 return $this->container->run(
144 'ApiMakeParserOptions',
145 [ $options, $title, $params, $module, &$reset, &$suppressCache ]
146 );
147 }
148
149 public function onApiMaxLagInfo( &$lagInfo ): void {
150 $this->container->run(
151 'ApiMaxLagInfo',
152 [ &$lagInfo ],
153 [ 'abortable' => false ]
154 );
155 }
156
157 public function onApiOpenSearchSuggest( &$results ) {
158 return $this->container->run(
159 'ApiOpenSearchSuggest',
160 [ &$results ]
161 );
162 }
163
164 public function onApiOptions( $apiModule, $user, $changes, $resetKinds ) {
165 return $this->container->run(
166 'ApiOptions',
167 [ $apiModule, $user, $changes, $resetKinds ]
168 );
169 }
170
171 public function onApiParseMakeOutputPage( $module, $output ) {
172 return $this->container->run(
173 'ApiParseMakeOutputPage',
174 [ $module, $output ]
175 );
176 }
177
178 public function onAPIQueryAfterExecute( $module ) {
179 return $this->container->run(
180 'APIQueryAfterExecute',
181 [ $module ]
182 );
183 }
184
185 public function onApiQueryBaseAfterQuery( $module, $result, &$hookData ) {
186 return $this->container->run(
187 'ApiQueryBaseAfterQuery',
188 [ $module, $result, &$hookData ]
189 );
190 }
191
192 public function onApiQueryBaseBeforeQuery( $module, &$tables, &$fields,
193 &$conds, &$query_options, &$join_conds, &$hookData
194 ) {
195 return $this->container->run(
196 'ApiQueryBaseBeforeQuery',
197 [ $module, &$tables, &$fields, &$conds, &$query_options,
198 &$join_conds, &$hookData ]
199 );
200 }
201
202 public function onApiQueryBaseProcessRow( $module, $row, &$data, &$hookData ) {
203 return $this->container->run(
204 'ApiQueryBaseProcessRow',
205 [ $module, $row, &$data, &$hookData ]
206 );
207 }
208
209 public function onAPIQueryGeneratorAfterExecute( $module, $resultPageSet ) {
210 return $this->container->run(
211 'APIQueryGeneratorAfterExecute',
212 [ $module, $resultPageSet ]
213 );
214 }
215
216 public function onAPIQuerySiteInfoGeneralInfo( $module, &$results ) {
217 return $this->container->run(
218 'APIQuerySiteInfoGeneralInfo',
219 [ $module, &$results ]
220 );
221 }
222
223 public function onAPIQuerySiteInfoStatisticsInfo( &$results ) {
224 return $this->container->run(
225 'APIQuerySiteInfoStatisticsInfo',
226 [ &$results ]
227 );
228 }
229
230 public function onApiQueryTokensRegisterTypes( &$salts ) {
231 return $this->container->run(
232 'ApiQueryTokensRegisterTypes',
233 [ &$salts ]
234 );
235 }
236
237 public function onApiQueryWatchlistExtractOutputData( $module, $watchedItem,
238 $recentChangeInfo, &$vals
239 ) {
240 return $this->container->run(
241 'ApiQueryWatchlistExtractOutputData',
242 [ $module, $watchedItem, $recentChangeInfo, &$vals ]
243 );
244 }
245
247 $module, $params, &$options
248 ) {
249 return $this->container->run(
250 'ApiQueryWatchlistPrepareWatchedItemQueryServiceOptions',
251 [ $module, $params, &$options ]
252 );
253 }
254
255 public function onApiQuery__moduleManager( $moduleManager ) {
256 return $this->container->run(
257 'ApiQuery::moduleManager',
258 [ $moduleManager ]
259 );
260 }
261
262 public function onApiRsdServiceApis( &$apis ) {
263 return $this->container->run(
264 'ApiRsdServiceApis',
265 [ &$apis ]
266 );
267 }
268
269 public function onApiValidatePassword( $module, &$r ) {
270 return $this->container->run(
271 'ApiValidatePassword',
272 [ $module, &$r ]
273 );
274 }
275
276 public function onChangeAuthenticationDataAudit( $req, $status ) {
277 return $this->container->run(
278 'ChangeAuthenticationDataAudit',
279 [ $req, $status ]
280 );
281 }
282
283 public function onEditFormPreloadText( &$text, $title ) {
284 return $this->container->run(
285 'EditFormPreloadText',
286 [ &$text, $title ]
287 );
288 }
289
290 public function onFileUndeleteComplete( $title, $fileVersions, $user, $reason ) {
291 return $this->container->run(
292 'FileUndeleteComplete',
293 [ $title, $fileVersions, $user, $reason ]
294 );
295 }
296
297 public function onGetLinkColours( $pagemap, &$classes, $title ) {
298 return $this->container->run(
299 'GetLinkColours',
300 [ $pagemap, &$classes, $title ]
301 );
302 }
303
304 public function onImportSources( &$importSources ) {
305 return $this->container->run(
306 'ImportSources',
307 [ &$importSources ]
308 );
309 }
310
311 public function onLanguageLinks( $title, &$links, &$linkFlags ) {
312 return $this->container->run(
313 'LanguageLinks',
314 [ $title, &$links, &$linkFlags ]
315 );
316 }
317
318 public function onOutputPageBeforeHTML( $out, &$text ) {
319 return $this->container->run(
320 'OutputPageBeforeHTML',
321 [ $out, &$text ]
322 );
323 }
324
325 public function onOutputPageCheckLastModified( &$modifiedTimes, $out ) {
326 return $this->container->run(
327 'OutputPageCheckLastModified',
328 [ &$modifiedTimes, $out ]
329 );
330 }
331
332 public function onRequestHasSameOriginSecurity( $request ) {
333 return $this->container->run(
334 'RequestHasSameOriginSecurity',
335 [ $request ]
336 );
337 }
338
339 public function onUserLoginComplete( $user, &$inject_html, $direct ) {
340 return $this->container->run(
341 'UserLoginComplete',
342 [ $user, &$inject_html, $direct ]
343 );
344 }
345
346 public function onUserLogoutComplete( $user, &$inject_html, $oldName ) {
347 return $this->container->run(
348 'UserLogoutComplete',
349 [ $user, &$inject_html, $oldName ]
350 );
351 }
352}
This class provides an implementation of the hook interfaces used by the core Action API,...
onOutputPageBeforeHTML( $out, &$text)
This hook is called when a page has been processed by the parser and the resulting HTML is about to b...
onRequestHasSameOriginSecurity( $request)
Use this hook to determine if the request is somehow flagged to lack same-origin security.
onAPIQueryGeneratorAfterExecute( $module, $resultPageSet)
This hook is called after calling the executeGenerator() method of an action=query submodule.
onApiQueryTokensRegisterTypes(&$salts)
Use this hook to add additional token types to action=query&meta=tokens.
onUserLoginComplete( $user, &$inject_html, $direct)
Use this hook to show custom content after a user has logged in via the web interface.
onEditFormPreloadText(&$text, $title)
Use this hook to populate the edit form when creating pages.
onApiMakeParserOptions( $options, $title, $params, $module, &$reset, &$suppressCache)
This hook is called from ApiParse and ApiExpandTemplates to allow extensions to adjust the ParserOpti...
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.
__construct(HookContainer $container)
onApiMain__moduleManager( $moduleManager)
This hook is called when ApiMain has finished initializing its module manager.
onApiOpenSearchSuggest(&$results)
This hook is called when constructing the OpenSearch results.
onGetLinkColours( $pagemap, &$classes, $title)
Use this hook to modify the CSS class of an array of page links.
onApiQueryBaseProcessRow( $module, $row, &$data, &$hookData)
This hook is called for (some) API query modules as each row of the database result is processed.
onApiMaxLagInfo(&$lagInfo)
This hook is called when lag information is being requested via API.
onFileUndeleteComplete( $title, $fileVersions, $user, $reason)
This hook is called when a file is undeleted.
onApiParseMakeOutputPage( $module, $output)
This hook is called when preparing the OutputPage object for ApiParse.
onApiFeedContributions__feedItem( $row, $context, &$feedItem)
Use this hook to convert the result of ContribsPager into a MediaWiki\Feed\FeedItem instance that Api...
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.
onApiValidatePassword( $module, &$r)
This hook is called from ApiValidatePassword.
onApiDeprecationHelp(&$msgs)
Use this hook to add messages to the 'deprecation-help' warning generated from ApiBase::addDeprecatio...
onAPIGetDescriptionMessages( $module, &$msg)
Use this hook to modify a module's help message.
onApiOptions( $apiModule, $user, $changes, $resetKinds)
This hook is called by action=options before applying changes to user preferences.
onOutputPageCheckLastModified(&$modifiedTimes, $out)
This hook is called when checking if the page has been modified since the last visit.
onApiCheckCanExecute( $module, $user, &$message)
This hook is called during ApiMain::checkCanExecute.
onAPIHelpModifyOutput( $module, &$help, $options, &$tocData)
Use this hook to modify an API module's help output.
onApiFormatHighlight( $context, $text, $mime, $format)
Use this hook to syntax-highlight API pretty-printed output.
onApiQuery__moduleManager( $moduleManager)
This hook is called when ApiQuery has finished initializing its module manager.
onApiMain__onException( $apiMain, $e)
This hook is called by ApiMain::executeActionWithErrorHandling() when an exception is thrown during A...
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.
onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions( $module, $params, &$options)
Use this hook to populate the options to be passed from ApiQueryWatchlist to WatchedItemQueryService.
onAPIGetParamDescriptionMessages( $module, &$msg)
Use this hook to modify a module's parameter descriptions.
onApiRsdServiceApis(&$apis)
Use this hook to add or remove APIs from the RSD services list.
onApiQueryWatchlistExtractOutputData( $module, $watchedItem, $recentChangeInfo, &$vals)
Use this hook to extract row data for ApiQueryWatchlist.
onAPIQuerySiteInfoGeneralInfo( $module, &$results)
Use this hook to add extra information to the site's general information.
onChangeAuthenticationDataAudit( $req, $status)
This hook is called when a user changes their password.
onUserLogoutComplete( $user, &$inject_html, $oldName)
This hook is called after a user has logged out.
onAPIGetAllowedParams( $module, &$params, $flags)
Use this hook to modify a module's parameters.
onAPIAfterExecute( $module)
This hook is called after calling the execute() method of an API module.
onAPIQuerySiteInfoStatisticsInfo(&$results)
Use this hook to add extra information to the site's statistics information.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
This is a hook handler interface, see docs/Hooks.md.
$mime
Definition router.php:60