File: MessageCacheFetchOverridesHook.php

package info (click to toggle)
mediawiki 1%3A1.43.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 417,464 kB
  • sloc: php: 1,062,949; javascript: 664,290; sql: 9,714; python: 5,458; xml: 3,489; sh: 1,131; makefile: 64
file content (29 lines) | stat: -rw-r--r-- 1,216 bytes parent folder | download
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
<?php

namespace MediaWiki\Cache\Hook;

/**
 * This is a hook handler interface, see docs/Hooks.md.
 * Use the hook name "MessageCacheFetchOverrides" to register handlers implementing this interface.
 *
 * @stable to implement
 * @ingroup Hooks
 */
interface MessageCacheFetchOverridesHook {
	/**
	 * This hook is called to fetch overrides. Use this hook to override message keys
	 * for customisations. Returned messages key must be formatted with:
	 * 1) the first letter in lower case according to the content language
	 * 2) spaces replaced with underscores
	 *
	 * @since 1.41
	 *
	 * @param (string|callable)[] &$keys Message keys mapped to their override. Values may also be a
	 *   callable that returns a message key. Callables are passed the message key,
	 *   the MessageCache instance, a Language/StubUserLang object and a boolean indicating if the
	 *   value should be fetched from the database. Note that strings will always be interpreted as
	 *   a message key; this is not valid callable syntax! This prevents ambiguity between message keys and functions.
	 *   Use Closure::fromCallable or another valid callable syntax.
	 */
	public function onMessageCacheFetchOverrides( array &$keys ): void;
}