From: Roan Kattouw Date: Wed, 11 May 2016 00:13:47 +0000 (-0700) Subject: Pass the OutputPage object to the OutputPageCheckLastModified hook X-Git-Tag: 1.31.0-rc.0~7026^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=commitdiff_plain;h=6ce974f95f5f68bfd65d849a01b6488f604510ee;p=lhc%2Fweb%2Fwiklou.git Pass the OutputPage object to the OutputPageCheckLastModified hook So that the hook function has a ContextSource. Change-Id: I044a5920b703a2d61a74c2d83d184b77caebb8f3 --- diff --git a/docs/hooks.txt b/docs/hooks.txt index a7092ec9e1..ab099b0898 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2128,6 +2128,7 @@ $sk: The Skin that called OutputPage::headElement since the last visit. &$modifiedTimes: array of timestamps. The following keys are set: page, user, epoch +$out: OutputPage object (since 1.28) 'OutputPageMakeCategoryLinks': Links are about to be generated for the page's categories. Implementations should return false if they generate the category diff --git a/includes/OutputPage.php b/includes/OutputPage.php index c724207034..67e9a4ff82 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -780,7 +780,7 @@ class OutputPage extends ContextSource { // bug 44570: the core page itself may not change, but resources might $modifiedTimes['sepoch'] = wfTimestamp( TS_MW, time() - $config->get( 'SquidMaxage' ) ); } - Hooks::run( 'OutputPageCheckLastModified', [ &$modifiedTimes ] ); + Hooks::run( 'OutputPageCheckLastModified', [ &$modifiedTimes, $this ] ); $maxModified = max( $modifiedTimes ); $this->mLastModified = wfTimestamp( TS_RFC2822, $maxModified );