Manual:Hooks/LocalisationCacheRecache

From MediaWiki.org
Jump to navigation Jump to search
LocalisationCacheRecache
Available from version 1.16.0 (r52503)
Called when loading the localisation data into cache
Define function:
public static function onLocalisationCacheRecache( $cache, $code, &$alldata, $purgeBlobs ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"LocalisationCacheRecache": "MyExtensionHooks::onLocalisationCacheRecache"
	}
}

For MediaWiki ≤1.25:

$wgHooks['LocalisationCacheRecache'][] = 'MyExtensionHooks::onLocalisationCacheRecache';
Called from:File(s): cache/localisation/LocalisationCache.php
Function(s): recache

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:LocalisationCacheRecache extensions.

Details[edit]

  • $cache: The LocalisationCache object
  • $code: language code
  • &$alldata: The localisation data from core and extensions
  • &$purgeBlobs: whether to purge/update the message blob via MessageBlobStore::clear()