Manual:Hooks/SetupAfterCache

From MediaWiki.org
Jump to: navigation, search
SetupAfterCache
Available from version 1.14.0
Called in Setup.php, after cache objects are set
Define function:
public static function onSetupAfterCache(   ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"SetupAfterCache": [
			"MyExtensionHooks::onSetupAfterCache"
		]
	}
}

For MediaWiki ≤1.25:

$wgHooks['SetupAfterCache'][] = 'MyExtensionHooks::onSetupAfterCache';
Called from: File(s): Setup.php

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

SetupAfterCache should only be used for initialization that actually needs to run right after $wgMemc stuff is created. Everything else should use $wgExtensionFunctions. If you need to use the RequestContext, consider BeforeInitialize and ApiBeforeMain hooks instead.