1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
|
<?php
namespace MediaWiki\Api;
use Article;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\Parser\ParserOptions;
use MediaWiki\Session\Session;
use MediaWiki\User\UserIdentity;
/**
* 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().
*/
class ApiHookRunner implements
Hook\APIAfterExecuteHook,
Hook\ApiCheckCanExecuteHook,
Hook\ApiDeprecationHelpHook,
Hook\ApiLogFeatureUsageHook,
Hook\ApiFeedContributions__feedItemHook,
Hook\ApiFormatHighlightHook,
Hook\APIGetAllowedParamsHook,
Hook\APIGetDescriptionMessagesHook,
Hook\APIGetParamDescriptionMessagesHook,
Hook\APIHelpModifyOutputHook,
Hook\ApiMain__moduleManagerHook,
Hook\ApiMain__onExceptionHook,
Hook\ApiMakeParserOptionsHook,
Hook\ApiMaxLagInfoHook,
Hook\ApiOpenSearchSuggestHook,
Hook\ApiOptionsHook,
Hook\ApiParseMakeOutputPageHook,
Hook\APIQueryAfterExecuteHook,
Hook\ApiQueryBaseAfterQueryHook,
Hook\ApiQueryBaseBeforeQueryHook,
Hook\ApiQueryBaseProcessRowHook,
Hook\APIQueryGeneratorAfterExecuteHook,
Hook\APIQuerySiteInfoGeneralInfoHook,
Hook\APIQuerySiteInfoStatisticsInfoHook,
Hook\ApiQueryTokensRegisterTypesHook,
Hook\ApiQueryWatchlistExtractOutputDataHook,
Hook\ApiQueryWatchlistPrepareWatchedItemQueryServiceOptionsHook,
Hook\ApiQuery__moduleManagerHook,
Hook\ApiRsdServiceApisHook,
Hook\ApiValidatePasswordHook,
Hook\RequestHasSameOriginSecurityHook,
\MediaWiki\Hook\EditFormPreloadTextHook,
\MediaWiki\Hook\FileUndeleteCompleteHook,
\MediaWiki\Hook\GetLinkColoursHook,
\MediaWiki\Hook\ImportSourcesHook,
\MediaWiki\Output\Hook\LanguageLinksHook,
\MediaWiki\Output\Hook\OutputPageBeforeHTMLHook,
\MediaWiki\Output\Hook\OutputPageCheckLastModifiedHook,
\MediaWiki\Page\Hook\ArticleParserOptionsHook,
\MediaWiki\Hook\TempUserCreatedRedirectHook,
\MediaWiki\Hook\UserLoginCompleteHook,
\MediaWiki\Hook\UserLogoutCompleteHook,
\MediaWiki\SpecialPage\Hook\ChangeAuthenticationDataAuditHook
{
private HookContainer $container;
public function __construct( HookContainer $container ) {
$this->container = $container;
}
public function onAPIAfterExecute( $module ) {
return $this->container->run(
'APIAfterExecute',
[ $module ]
);
}
public function onApiCheckCanExecute( $module, $user, &$message ) {
return $this->container->run(
'ApiCheckCanExecute',
[ $module, $user, &$message ]
);
}
public function onApiDeprecationHelp( &$msgs ) {
return $this->container->run(
'ApiDeprecationHelp',
[ &$msgs ]
);
}
public function onApiFeedContributions__feedItem( $row, $context, &$feedItem ) {
return $this->container->run(
'ApiFeedContributions::feedItem',
[ $row, $context, &$feedItem ]
);
}
public function onApiFormatHighlight( $context, $text, $mime, $format ) {
return $this->container->run(
'ApiFormatHighlight',
[ $context, $text, $mime, $format ]
);
}
public function onAPIGetAllowedParams( $module, &$params, $flags ) {
return $this->container->run(
'APIGetAllowedParams',
[ $module, &$params, $flags ]
);
}
public function onAPIGetDescriptionMessages( $module, &$msg ) {
return $this->container->run(
'APIGetDescriptionMessages',
[ $module, &$msg ]
);
}
public function onAPIGetParamDescriptionMessages( $module, &$msg ) {
return $this->container->run(
'APIGetParamDescriptionMessages',
[ $module, &$msg ]
);
}
public function onAPIHelpModifyOutput( $module, &$help, $options, &$tocData ) {
return $this->container->run(
'APIHelpModifyOutput',
[ $module, &$help, $options, &$tocData ]
);
}
public function onApiLogFeatureUsage( $feature, array $clientInfo ): void {
$this->container->run(
'ApiLogFeatureUsage',
[ $feature, $clientInfo ]
);
}
public function onApiMain__moduleManager( $moduleManager ) {
return $this->container->run(
'ApiMain::moduleManager',
[ $moduleManager ]
);
}
public function onApiMain__onException( $apiMain, $e ) {
return $this->container->run(
'ApiMain::onException',
[ $apiMain, $e ]
);
}
public function onApiMakeParserOptions( $options, $title, $params, $module,
&$reset, &$suppressCache
) {
return $this->container->run(
'ApiMakeParserOptions',
[ $options, $title, $params, $module, &$reset, &$suppressCache ]
);
}
public function onApiMaxLagInfo( &$lagInfo ): void {
$this->container->run(
'ApiMaxLagInfo',
[ &$lagInfo ],
[ 'abortable' => false ]
);
}
public function onApiOpenSearchSuggest( &$results ) {
return $this->container->run(
'ApiOpenSearchSuggest',
[ &$results ]
);
}
public function onApiOptions( $apiModule, $user, $changes, $resetKinds ) {
return $this->container->run(
'ApiOptions',
[ $apiModule, $user, $changes, $resetKinds ]
);
}
public function onApiParseMakeOutputPage( $module, $output ) {
return $this->container->run(
'ApiParseMakeOutputPage',
[ $module, $output ]
);
}
public function onAPIQueryAfterExecute( $module ) {
return $this->container->run(
'APIQueryAfterExecute',
[ $module ]
);
}
public function onApiQueryBaseAfterQuery( $module, $result, &$hookData ) {
return $this->container->run(
'ApiQueryBaseAfterQuery',
[ $module, $result, &$hookData ]
);
}
public function onApiQueryBaseBeforeQuery( $module, &$tables, &$fields,
&$conds, &$query_options, &$join_conds, &$hookData
) {
return $this->container->run(
'ApiQueryBaseBeforeQuery',
[ $module, &$tables, &$fields, &$conds, &$query_options,
&$join_conds, &$hookData ]
);
}
public function onApiQueryBaseProcessRow( $module, $row, &$data, &$hookData ) {
return $this->container->run(
'ApiQueryBaseProcessRow',
[ $module, $row, &$data, &$hookData ]
);
}
public function onAPIQueryGeneratorAfterExecute( $module, $resultPageSet ) {
return $this->container->run(
'APIQueryGeneratorAfterExecute',
[ $module, $resultPageSet ]
);
}
public function onAPIQuerySiteInfoGeneralInfo( $module, &$results ) {
return $this->container->run(
'APIQuerySiteInfoGeneralInfo',
[ $module, &$results ]
);
}
public function onAPIQuerySiteInfoStatisticsInfo( &$results ) {
return $this->container->run(
'APIQuerySiteInfoStatisticsInfo',
[ &$results ]
);
}
public function onApiQueryTokensRegisterTypes( &$salts ) {
return $this->container->run(
'ApiQueryTokensRegisterTypes',
[ &$salts ]
);
}
public function onApiQueryWatchlistExtractOutputData( $module, $watchedItem,
$recentChangeInfo, &$vals
) {
return $this->container->run(
'ApiQueryWatchlistExtractOutputData',
[ $module, $watchedItem, $recentChangeInfo, &$vals ]
);
}
public function onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions(
$module, $params, &$options
) {
return $this->container->run(
'ApiQueryWatchlistPrepareWatchedItemQueryServiceOptions',
[ $module, $params, &$options ]
);
}
public function onApiQuery__moduleManager( $moduleManager ) {
return $this->container->run(
'ApiQuery::moduleManager',
[ $moduleManager ]
);
}
public function onApiRsdServiceApis( &$apis ) {
return $this->container->run(
'ApiRsdServiceApis',
[ &$apis ]
);
}
public function onApiValidatePassword( $module, &$r ) {
return $this->container->run(
'ApiValidatePassword',
[ $module, &$r ]
);
}
public function onArticleParserOptions( Article $article, ParserOptions $popts ) {
return $this->container->run(
'ArticleParserOptions',
[ $article, $popts ]
);
}
public function onChangeAuthenticationDataAudit( $req, $status ) {
return $this->container->run(
'ChangeAuthenticationDataAudit',
[ $req, $status ]
);
}
public function onEditFormPreloadText( &$text, $title ) {
return $this->container->run(
'EditFormPreloadText',
[ &$text, $title ]
);
}
public function onFileUndeleteComplete( $title, $fileVersions, $user, $reason ) {
return $this->container->run(
'FileUndeleteComplete',
[ $title, $fileVersions, $user, $reason ]
);
}
public function onGetLinkColours( $pagemap, &$classes, $title ) {
return $this->container->run(
'GetLinkColours',
[ $pagemap, &$classes, $title ]
);
}
public function onImportSources( &$importSources ) {
return $this->container->run(
'ImportSources',
[ &$importSources ]
);
}
public function onLanguageLinks( $title, &$links, &$linkFlags ) {
return $this->container->run(
'LanguageLinks',
[ $title, &$links, &$linkFlags ]
);
}
public function onOutputPageBeforeHTML( $out, &$text ) {
return $this->container->run(
'OutputPageBeforeHTML',
[ $out, &$text ]
);
}
public function onOutputPageCheckLastModified( &$modifiedTimes, $out ) {
return $this->container->run(
'OutputPageCheckLastModified',
[ &$modifiedTimes, $out ]
);
}
public function onRequestHasSameOriginSecurity( $request ) {
return $this->container->run(
'RequestHasSameOriginSecurity',
[ $request ]
);
}
public function onTempUserCreatedRedirect(
Session $session,
UserIdentity $user,
string $returnTo,
string $returnToQuery,
string $returnToAnchor,
&$redirectUrl
) {
return $this->container->run(
'TempUserCreatedRedirect',
[ $session, $user, $returnTo, $returnToQuery, $returnToAnchor, &$redirectUrl ]
);
}
public function onUserLoginComplete( $user, &$inject_html, $direct ) {
return $this->container->run(
'UserLoginComplete',
[ $user, &$inject_html, $direct ]
);
}
public function onUserLogoutComplete( $user, &$inject_html, $oldName ) {
return $this->container->run(
'UserLogoutComplete',
[ $user, &$inject_html, $oldName ]
);
}
}
|