Merge "Pass $context to 'GetPreferences' hook"
[lhc/web/wiklou.git] / includes / changes / ChangesFeed.php
index ca6ba48..7ac8cd0 100644 (file)
@@ -20,6 +20,8 @@
  * @file
  */
 
+use Wikimedia\Rdbms\ResultWrapper;
+
 /**
  * Feed to Special:RecentChanges and Special:RecentChangesLiked
  *
@@ -29,8 +31,6 @@ class ChangesFeed {
        public $format, $type, $titleMsg, $descMsg;
 
        /**
-        * Constructor
-        *
         * @param string $format Feed's format (either 'rss' or 'atom')
         * @param string $type Type of feed (for cache keys)
         */
@@ -82,10 +82,11 @@ class ChangesFeed {
                        return null;
                }
 
+               $cache = ObjectCache::getMainWANInstance();
                $optionsHash = md5( serialize( $opts->getAllValues() ) ) . $wgRenderHashAppend;
-               $timekey = wfMemcKey(
+               $timekey = $cache->makeKey(
                        $this->type, $this->format, $wgLang->getCode(), $optionsHash, 'timestamp' );
-               $key = wfMemcKey( $this->type, $this->format, $wgLang->getCode(), $optionsHash );
+               $key = $cache->makeKey( $this->type, $this->format, $wgLang->getCode(), $optionsHash );
 
                FeedUtils::checkPurge( $timekey, $key );
 
@@ -152,7 +153,7 @@ 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
+                                       $wgOut->setLastModified( $feedLastmod ); // T23916
                                }
                                return $cache->get( $key );
                        } else {
@@ -164,8 +165,8 @@ class ChangesFeed {
 
        /**
         * Generate the feed items given a row from the database, printing the feed.
-        * @param object $rows DatabaseBase resource with recentchanges rows
-        * @param ChannelFeed $feed
+        * @param object $rows IDatabase resource with recentchanges rows
+        * @param ChannelFeed &$feed
         */
        public static function generateFeed( $rows, &$feed ) {
                $items = self::buildItems( $rows );
@@ -178,7 +179,7 @@ class ChangesFeed {
 
        /**
         * Generate the feed items given a row from the database.
-        * @param object $rows DatabaseBase resource with recentchanges rows
+        * @param object $rows IDatabase resource with recentchanges rows
         * @return array
         */
        public static function buildItems( $rows ) {