MediaWiki fundraising/REL1_35
ApiHookRunner.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Api;
4
6
14class ApiHookRunner implements
58{
60 private $container;
61
63 $this->container = $container;
64 }
65
66 public function onAPIAfterExecute( $module ) {
67 return $this->container->run(
68 'APIAfterExecute',
69 [ $module ]
70 );
71 }
72
73 public function onApiCheckCanExecute( $module, $user, &$message ) {
74 return $this->container->run(
75 'ApiCheckCanExecute',
76 [ $module, $user, &$message ]
77 );
78 }
79
80 public function onApiDeprecationHelp( &$msgs ) {
81 return $this->container->run(
82 'ApiDeprecationHelp',
83 [ &$msgs ]
84 );
85 }
86
87 public function onApiFeedContributions__feedItem( $row, $context, &$feedItem ) {
88 return $this->container->run(
89 'ApiFeedContributions::feedItem',
90 [ $row, $context, &$feedItem ]
91 );
92 }
93
94 public function onApiFormatHighlight( $context, $text, $mime, $format ) {
95 return $this->container->run(
96 'ApiFormatHighlight',
97 [ $context, $text, $mime, $format ]
98 );
99 }
100
101 public function onAPIGetAllowedParams( $module, &$params, $flags ) {
102 return $this->container->run(
103 'APIGetAllowedParams',
104 [ $module, &$params, $flags ]
105 );
106 }
107
108 public function onAPIGetDescriptionMessages( $module, &$msg ) {
109 return $this->container->run(
110 'APIGetDescriptionMessages',
111 [ $module, &$msg ]
112 );
113 }
114
115 public function onAPIGetParamDescriptionMessages( $module, &$msg ) {
116 return $this->container->run(
117 'APIGetParamDescriptionMessages',
118 [ $module, &$msg ]
119 );
120 }
121
122 public function onAPIHelpModifyOutput( $module, &$help, $options, &$tocData ) {
123 return $this->container->run(
124 'APIHelpModifyOutput',
125 [ $module, &$help, $options, &$tocData ]
126 );
127 }
128
129 public function onApiMain__moduleManager( $moduleManager ) {
130 return $this->container->run(
131 'ApiMain::moduleManager',
132 [ $moduleManager ]
133 );
134 }
135
136 public function onApiMain__onException( $apiMain, $e ) {
137 return $this->container->run(
138 'ApiMain::onException',
139 [ $apiMain, $e ]
140 );
141 }
142
143 public function onApiMakeParserOptions( $options, $title, $params, $module,
144 &$reset, &$suppressCache
145 ) {
146 return $this->container->run(
147 'ApiMakeParserOptions',
148 [ $options, $title, $params, $module, &$reset, &$suppressCache ]
149 );
150 }
151
152 public function onApiMaxLagInfo( &$lagInfo ) : void {
153 $this->container->run(
154 'ApiMaxLagInfo',
155 [ &$lagInfo ],
156 [ 'abortable' => false ]
157 );
158 }
159
160 public function onApiOpenSearchSuggest( &$results ) {
161 return $this->container->run(
162 'ApiOpenSearchSuggest',
163 [ &$results ]
164 );
165 }
166
167 public function onApiOptions( $apiModule, $user, $changes, $resetKinds ) {
168 return $this->container->run(
169 'ApiOptions',
170 [ $apiModule, $user, $changes, $resetKinds ]
171 );
172 }
173
174 public function onApiParseMakeOutputPage( $module, $output ) {
175 return $this->container->run(
176 'ApiParseMakeOutputPage',
177 [ $module, $output ]
178 );
179 }
180
181 public function onAPIQueryAfterExecute( $module ) {
182 return $this->container->run(
183 'APIQueryAfterExecute',
184 [ $module ]
185 );
186 }
187
188 public function onApiQueryBaseAfterQuery( $module, $result, &$hookData ) {
189 return $this->container->run(
190 'ApiQueryBaseAfterQuery',
191 [ $module, $result, &$hookData ]
192 );
193 }
194
195 public function onApiQueryBaseBeforeQuery( $module, &$tables, &$fields,
196 &$conds, &$query_options, &$join_conds, &$hookData
197 ) {
198 return $this->container->run(
199 'ApiQueryBaseBeforeQuery',
200 [ $module, &$tables, &$fields, &$conds, &$query_options,
201 &$join_conds, &$hookData ]
202 );
203 }
204
205 public function onApiQueryBaseProcessRow( $module, $row, &$data, &$hookData ) {
206 return $this->container->run(
207 'ApiQueryBaseProcessRow',
208 [ $module, $row, &$data, &$hookData ]
209 );
210 }
211
212 public function onAPIQueryGeneratorAfterExecute( $module, $resultPageSet ) {
213 return $this->container->run(
214 'APIQueryGeneratorAfterExecute',
215 [ $module, $resultPageSet ]
216 );
217 }
218
219 public function onAPIQueryInfoTokens( &$tokenFunctions ) {
220 return $this->container->run(
221 'APIQueryInfoTokens',
222 [ &$tokenFunctions ]
223 );
224 }
225
226 public function onAPIQueryRecentChangesTokens( &$tokenFunctions ) {
227 return $this->container->run(
228 'APIQueryRecentChangesTokens',
229 [ &$tokenFunctions ]
230 );
231 }
232
233 public function onAPIQueryRevisionsTokens( &$tokenFunctions ) {
234 return $this->container->run(
235 'APIQueryRevisionsTokens',
236 [ &$tokenFunctions ]
237 );
238 }
239
240 public function onAPIQuerySiteInfoGeneralInfo( $module, &$results ) {
241 return $this->container->run(
242 'APIQuerySiteInfoGeneralInfo',
243 [ $module, &$results ]
244 );
245 }
246
247 public function onAPIQuerySiteInfoStatisticsInfo( &$results ) {
248 return $this->container->run(
249 'APIQuerySiteInfoStatisticsInfo',
250 [ &$results ]
251 );
252 }
253
254 public function onApiQueryTokensRegisterTypes( &$salts ) {
255 return $this->container->run(
256 'ApiQueryTokensRegisterTypes',
257 [ &$salts ]
258 );
259 }
260
261 public function onAPIQueryUsersTokens( &$tokenFunctions ) {
262 return $this->container->run(
263 'APIQueryUsersTokens',
264 [ &$tokenFunctions ]
265 );
266 }
267
268 public function onApiQueryWatchlistExtractOutputData( $module, $watchedItem,
269 $recentChangeInfo, &$vals
270 ) {
271 return $this->container->run(
272 'ApiQueryWatchlistExtractOutputData',
273 [ $module, $watchedItem, $recentChangeInfo, &$vals ]
274 );
275 }
276
278 $module, $params, &$options
279 ) {
280 return $this->container->run(
281 'ApiQueryWatchlistPrepareWatchedItemQueryServiceOptions',
282 [ $module, $params, &$options ]
283 );
284 }
285
286 public function onApiQuery__moduleManager( $moduleManager ) {
287 return $this->container->run(
288 'ApiQuery::moduleManager',
289 [ $moduleManager ]
290 );
291 }
292
293 public function onApiRsdServiceApis( &$apis ) {
294 return $this->container->run(
295 'ApiRsdServiceApis',
296 [ &$apis ]
297 );
298 }
299
300 public function onApiTokensGetTokenTypes( &$tokenTypes ) {
301 return $this->container->run(
302 'ApiTokensGetTokenTypes',
303 [ &$tokenTypes ]
304 );
305 }
306
307 public function onApiValidatePassword( $module, &$r ) {
308 return $this->container->run(
309 'ApiValidatePassword',
310 [ $module, &$r ]
311 );
312 }
313
314 public function onChangeAuthenticationDataAudit( $req, $status ) {
315 return $this->container->run(
316 'ChangeAuthenticationDataAudit',
317 [ $req, $status ]
318 );
319 }
320
321 public function onEditFormPreloadText( &$text, $title ) {
322 return $this->container->run(
323 'EditFormPreloadText',
324 [ &$text, $title ]
325 );
326 }
327
328 public function onFileUndeleteComplete( $title, $fileVersions, $user, $reason ) {
329 return $this->container->run(
330 'FileUndeleteComplete',
331 [ $title, $fileVersions, $user, $reason ]
332 );
333 }
334
335 public function onImportSources( &$importSources ) {
336 return $this->container->run(
337 'ImportSources',
338 [ &$importSources ]
339 );
340 }
341
342 public function onLanguageLinks( $title, &$links, &$linkFlags ) {
343 return $this->container->run(
344 'LanguageLinks',
345 [ $title, &$links, &$linkFlags ]
346 );
347 }
348
349 public function onOutputPageCheckLastModified( &$modifiedTimes, $out ) {
350 return $this->container->run(
351 'OutputPageCheckLastModified',
352 [ &$modifiedTimes, $out ]
353 );
354 }
355
356 public function onRequestHasSameOriginSecurity( $request ) {
357 return $this->container->run(
358 'RequestHasSameOriginSecurity',
359 [ $request ]
360 );
361 }
362
363 public function onUserLoginComplete( $user, &$inject_html, $direct ) {
364 return $this->container->run(
365 'UserLoginComplete',
366 [ $user, &$inject_html, $direct ]
367 );
368 }
369
370 public function onUserLogoutComplete( $user, &$inject_html, $oldName ) {
371 return $this->container->run(
372 'UserLogoutComplete',
373 [ $user, &$inject_html, $oldName ]
374 );
375 }
376}
This class provides an implementation of the hook interfaces used by the core Action API,...
onRequestHasSameOriginSecurity( $request)
Use this hook to determine if the request is somehow flagged to lack same-origin security.
onApiTokensGetTokenTypes(&$tokenTypes)
Use this hook to extend action=tokens with new token types.
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.
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.
onAPIQueryRecentChangesTokens(&$tokenFunctions)
Use this hook to add custom tokens to list=recentchanges.
onApiFeedContributions__feedItem( $row, $context, &$feedItem)
Use this hook to convert the result of ContribsPager into a FeedItem instance that ApiFeedContributio...
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.
onAPIQueryRevisionsTokens(&$tokenFunctions)
Use this hook to add custom tokens to prop=revisions.
onAPIHelpModifyOutput( $module, &$help, $options, &$tocData)
Use this hook to modify an API module's help output.
onAPIQueryUsersTokens(&$tokenFunctions)
Use this hook to add custom token to list=users.
onAPIQueryInfoTokens(&$tokenFunctions)
Use this hook to add custom tokens to prop=info.
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.
$help
Definition mcc.php:32
$mime
Definition router.php:60