Added new hook 'MessageCacheReplace' into MessageCache.php. For instance
authorEmil Podlaszewski <emil@users.mediawiki.org>
Wed, 8 Apr 2009 14:23:14 +0000 (14:23 +0000)
committerEmil Podlaszewski <emil@users.mediawiki.org>
Wed, 8 Apr 2009 14:23:14 +0000 (14:23 +0000)
to allow extensions to update caches in similar way as MediaWiki invalidates
a cached MonoBook sidebar

RELEASE-NOTES
docs/hooks.txt
includes/MessageCache.php

index b212ad3..62a861a 100644 (file)
@@ -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.
index 565e78c..9cfaa39 100644 (file)
@@ -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
index 2236bdd..185b617 100644 (file)
@@ -407,6 +407,8 @@ class MessageCache {
                $sidebarKey = wfMemcKey( 'sidebar', $code );
                $parserMemc->delete( $sidebarKey );
 
+               wfRunHooks( "MessageCacheReplace", array( $title, $text ) );
+
                wfProfileOut( __METHOD__ );
        }