diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
commit | 9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch) | |
tree | 46d1a0dee7febef5c2d57a9f7b972be16a163b3d /includes/ChangesFeed.php | |
parent | 78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff) |
update to MediaWiki 1.17.0
Diffstat (limited to 'includes/ChangesFeed.php')
-rw-r--r-- | includes/ChangesFeed.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/includes/ChangesFeed.php b/includes/ChangesFeed.php index bc50fe02..f07b6505 100644 --- a/includes/ChangesFeed.php +++ b/includes/ChangesFeed.php @@ -27,8 +27,8 @@ class ChangesFeed { * @return ChannelFeed subclass or false on failure */ public function getFeedObject( $title, $description ) { - global $wgSitename, $wgContLanguageCode, $wgFeedClasses, $wgTitle; - $feedTitle = "$wgSitename - {$title} [$wgContLanguageCode]"; + global $wgSitename, $wgLanguageCode, $wgFeedClasses, $wgTitle; + $feedTitle = "$wgSitename - {$title} [$wgLanguageCode]"; if( !isset($wgFeedClasses[$this->format] ) ) return false; return new $wgFeedClasses[$this->format]( @@ -45,18 +45,17 @@ class ChangesFeed { * @return null or true */ public function execute( $feed, $rows, $lastmod, $opts ) { - global $messageMemc, $wgFeedCacheTimeout; - global $wgSitename, $wgLang; + global $wgLang, $wgRenderHashAppend; if ( !FeedUtils::checkFeedOutput( $this->format ) ) { return; } - $timekey = wfMemcKey( $this->type, $this->format, 'timestamp' ); - $optionsHash = md5( serialize( $opts->getAllValues() ) ); + $optionsHash = md5( serialize( $opts->getAllValues() ) ) . $wgRenderHashAppend; + $timekey = wfMemcKey( $this->type, $this->format, $wgLang->getCode(), $optionsHash, 'timestamp' ); $key = wfMemcKey( $this->type, $this->format, $wgLang->getCode(), $optionsHash ); - FeedUtils::checkPurge($timekey, $key); + FeedUtils::checkPurge( $timekey, $key ); /* * Bumping around loading up diffs can be pretty slow, so where @@ -102,7 +101,8 @@ class ChangesFeed { * @return feed's content on cache hit or false on cache miss */ public function loadFromCache( $lastmod, $timekey, $key ) { - global $wgFeedCacheTimeout, $messageMemc; + global $wgFeedCacheTimeout, $wgOut, $messageMemc; + $feedLastmod = $messageMemc->get( $timekey ); if( ( $wgFeedCacheTimeout > 0 ) && $feedLastmod ) { @@ -119,6 +119,9 @@ class ChangesFeed { if( $feedAge < $wgFeedCacheTimeout || $feedLastmodUnix > $lastmodUnix) { wfDebug( "RC: loading feed from cache ($key; $feedLastmod; $lastmod)...\n" ); + if ( $feedLastmodUnix < $lastmodUnix ) { + $wgOut->setLastModified( $feedLastmod ); // bug 21916 + } return $messageMemc->get( $key ); } else { wfDebug( "RC: cached feed timestamp check failed ($feedLastmod; $lastmod)\n" ); |