| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\ResourceLoader\Hook; |
| 4 | |
| 5 | use MediaWiki\Config\Config; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "ResourceLoaderGetConfigVars" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup ResourceLoaderHooks |
| 13 | */ |
| 14 | interface ResourceLoaderGetConfigVarsHook { |
| 15 | /** |
| 16 | * Export static site-wide `mw.config` variables to JavaScript. |
| 17 | * |
| 18 | * Variables that depend on the current page or request state must be added |
| 19 | * through MediaWiki\Hook\MakeGlobalVariablesScriptHook instead. |
| 20 | * The skin name is made available to send skin-specific config only when needed. |
| 21 | * |
| 22 | * This hook is called from ResourceLoaderStartUpModule. |
| 23 | * |
| 24 | * @since 1.35 |
| 25 | * @param array &$vars `[ variable name => value ]` |
| 26 | * @param string $skin |
| 27 | * @param Config $config since 1.34 |
| 28 | * @return void This hook must not abort, it must return no value |
| 29 | */ |
| 30 | public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ): void; |
| 31 | } |