3 namespace MediaWiki\Hook
;
6 * This is a hook handler interface, see docs/Hooks.md.
7 * Use the hook name "ParserOptionsRegister" to register handlers implementing this interface.
12 interface ParserOptionsRegisterHook
{
14 * Use this hook to register additional parser options. Note that if you
15 * change the default value for an option, all existing parser cache entries will
16 * be invalid. To avoid bugs, you'll need to handle that somehow (e.g. with the
17 * RejectParserCacheValue hook) because MediaWiki won't do it for you.
21 * @param array &$defaults Set the default value for your option here
22 * @param array &$inCacheKey To fragment the parser cache on your option, set a truthy value
23 * in this array, with the key being the option name.
24 * @param array &$lazyLoad To lazy-initialize your option, set it null in $defaults and set a
25 * callable in this array, with the key being the option name. The callable is passed
26 * the ParserOptions object and the option name.
27 * @return bool|void True or no return value to continue or false to abort
29 public function onParserOptionsRegister( &$defaults, &$inCacheKey, &$lazyLoad );