Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:Hooks/SetupAfterCache

From mediawiki.org
<Manual:Hooks
SetupAfterCache
Available fromversion 1.14.0
Called in Setup.php, after cache objects are set
Define function:
publicstaticfunctiononSetupAfterCache(){...}
Attach hook:Inextension.json:
{"Hooks":{"SetupAfterCache":"MediaWiki\\Extension\\MyExtension\\Hooks::onSetupAfterCache"}}
Called from:File(s):Setup.php
Interface:SetupAfterCacheHook.php

For more information about attaching hooks, seeManual:Hooks.
For examples of extensions using this hook, seeCategory:SetupAfterCache extensions.


Usage

[edit]
  • SetupAfterCache should only be used for any initialization that needs to run right aftercache objects are set.
  • SetupAfterCache is not safe place forchanging global configuration settings, because some services might have already been instantiated by the time this (or any) hook runs. The only safe place for manipulating configuration variables is anextension registration callback. TheMediaWikiServices hook can be used as a stop-gap alternative for cases where a registration callback is not sufficient, but it is not entirely safe.
Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:Hooks/SetupAfterCache&oldid=7488241"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp