MediaWiki master
HookRunner.php
Go to the documentation of this file.
1<?php
2
4
7
13class HookRunner implements
21{
23 private $container;
24
25 public function __construct( HookContainer $container ) {
26 $this->container = $container;
27 }
28
29 public function onResourceLoaderExcludeUserOptions( array &$keysToExclude, Context $context ): void {
30 $this->container->run(
31 'ResourceLoaderExcludeUserOptions',
32 [ &$keysToExclude, $context ],
33 [ 'abortable' => false ]
34 );
35 }
36
37 public function onResourceLoaderForeignApiModules( &$dependencies, $context ): void {
38 $this->container->run(
39 'ResourceLoaderForeignApiModules',
40 [ &$dependencies, $context ],
41 [ 'abortable' => false ]
42 );
43 }
44
45 public function onResourceLoaderRegisterModules( ResourceLoader $rl ): void {
46 $this->container->run(
47 'ResourceLoaderRegisterModules',
48 [ $rl ],
49 [ 'abortable' => false ]
50 );
51 }
52
53 public function onResourceLoaderSiteModulePages( $skin, array &$pages ): void {
54 $this->container->run(
55 'ResourceLoaderSiteModulePages',
56 [ $skin, &$pages ],
57 [ 'abortable' => false ]
58 );
59 }
60
61 public function onResourceLoaderSiteStylesModulePages( $skin, array &$pages ): void {
62 $this->container->run(
63 'ResourceLoaderSiteStylesModulePages',
64 [ $skin, &$pages ],
65 [ 'abortable' => false ]
66 );
67 }
68
69 public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ): void {
70 $this->container->run(
71 'ResourceLoaderGetConfigVars',
72 [ &$vars, $skin, $config ],
73 [ 'abortable' => false ]
74 );
75 }
76
78 array &$magicWords
79 ): void {
80 $this->container->run(
81 'ResourceLoaderJqueryMsgModuleMagicWords',
82 [ $context, &$magicWords ],
83 [ 'abortable' => false ]
84 );
85 }
86}
$magicWords
@phpcs-require-sorted-array
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Context object that contains information about the state of a specific ResourceLoader web request.
Definition Context.php:45
onResourceLoaderForeignApiModules(&$dependencies, $context)
Add dependencies to the mediawiki.ForeignApi module when you wish to override its behavior.
onResourceLoaderExcludeUserOptions(array &$keysToExclude, Context $context)
Exclude a user option from the preloaded data for client-side mw.user.options.
onResourceLoaderSiteModulePages( $skin, array &$pages)
Change which wiki pages comprise the site module in given skin.
onResourceLoaderRegisterModules(ResourceLoader $rl)
This hook is called right before modules information is required, such as when responding to a resour...
__construct(HookContainer $container)
onResourceLoaderGetConfigVars(array &$vars, $skin, Config $config)
Export static site-wide mw.config variables to JavaScript.
onResourceLoaderSiteStylesModulePages( $skin, array &$pages)
Change which wiki pages comprise the site.styles module in given skin.
onResourceLoaderJqueryMsgModuleMagicWords(Context $context, array &$magicWords)
Add magic words to the mediawiki.jqueryMsg module.
ResourceLoader is a loading system for JavaScript and CSS resources.
Interface for configuration instances.
Definition Config.php:32