From: Emil Podlaszewski Date: Wed, 8 Apr 2009 14:23:14 +0000 (+0000) Subject: Added new hook 'MessageCacheReplace' into MessageCache.php. For instance X-Git-Tag: 1.31.0-rc.0~42194 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=f04ca60561fcbd5d3f6b566dd48f25febbdad197;hp=7cd3575c5dfa598f9818c3bbf56f44c9ec3fba07;p=lhc%2Fweb%2Fwiklou.git 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 --- 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__ ); }