From e311f6f868885ce5f85d2fe25ee798104455fdc7 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 17 May 2013 15:18:48 +0200 Subject: [PATCH] TitleSquidURLs hook for changing the URLs to purge This allows extensions to purge derivative resources that need updating when a wiki page is changed. Change-Id: Ic28ce7f57f29376b041627288979981fcb218a44 --- RELEASE-NOTES-1.22 | 2 ++ docs/hooks.txt | 4 ++++ includes/Title.php | 1 + 3 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 168f2f7a10..6b13e013d3 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -79,6 +79,8 @@ production. which can be cascading (previously 'sysop' was hard-coded as the only one). * XHTML5 support has been improved. If you set $wgMimeType = 'application/xhtml+xml' MediaWiki will try outputting markup acording to XHTML5 rules. +* New hook 'TitleSquidURLs' for manipulating the list of URLs to be purged from + HTTP caches when a page is changed. === Bug fixes in 1.22 === * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one diff --git a/docs/hooks.txt b/docs/hooks.txt index a292997469..f94a1b002e 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2379,6 +2379,10 @@ $title: Title object being checked against $user: Current user object &$whitelisted: Boolean value of whether this title is whitelisted +'TitleSquidURLs': Called to determine which URLs to purge from HTTP caches. +$this: Title object to purge +&$urls: An array of URLs to purge from the caches, to be manipulated. + 'UndeleteForm::showHistory': Called in UndeleteForm::showHistory, after a PageArchive object has been created but before any further processing is done. &$archive: PageArchive object diff --git a/includes/Title.php b/includes/Title.php index 14915e58ed..8a37f68697 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3448,6 +3448,7 @@ class Title { } } + wfRunHooks( 'TitleSquidURLs', array( $this, &$urls ) ); return $urls; } -- 2.20.1