From f04ca60561fcbd5d3f6b566dd48f25febbdad197 Mon Sep 17 00:00:00 2001 From: Emil Podlaszewski Date: Wed, 8 Apr 2009 14:23:14 +0000 Subject: [PATCH] Added new hook 'MessageCacheReplace' into MessageCache.php. For instance to allow extensions to update caches in similar way as MediaWiki invalidates a cached MonoBook sidebar --- RELEASE-NOTES | 3 +++ docs/hooks.txt | 4 ++++ includes/MessageCache.php | 2 ++ 3 files changed, 9 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b212ad33a8..62a861ad6f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -160,6 +160,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN "{{GROUPCONVERT:xxx}}" enabled for this new feature. You can set related conversion rules in [[MediaWiki:Groupconversiontable-xxx/language_code]]. * Superfluous border="0" removed from images +* Added new hook 'MessageCacheReplace' into MessageCache.php. For instance + to allow extensions to update caches in similar way as MediaWiki invalidates + a cached MonoBook sidebar === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/docs/hooks.txt b/docs/hooks.txt index 565e78cc29..9cfaa39eb9 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -935,6 +935,10 @@ $this: The $mediawiki object $title: title of the message (string) $message: value (string), change it to the message you want to define +'MessageCacheReplace': When a message page is changed. Useful for updating caches. +$title: name of the page changed. +$text: new contents of the page. + 'MonoBookTemplateToolboxEnd': Called by Monobook skin after toolbox links have been rendered (useful for adding more) Note: this is only run for the Monobook skin. To add items to the toolbox for all 'SkinTemplate'-type skins, use the SkinTemplateToolboxEnd hook diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 2236bdd702..185b617d26 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -407,6 +407,8 @@ class MessageCache { $sidebarKey = wfMemcKey( 'sidebar', $code ); $parserMemc->delete( $sidebarKey ); + wfRunHooks( "MessageCacheReplace", array( $title, $text ) ); + wfProfileOut( __METHOD__ ); } -- 2.20.1