*/
use Wikimedia\Rdbms\ResultWrapper;
+use MediaWiki\MediaWikiServices;
/**
* Feed to Special:RecentChanges and Special:RecentChangesLiked
return null;
}
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
$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 );
* @param string $key Memcached key of the content
*/
public function saveToCache( $feed, $timekey, $key ) {
- $cache = ObjectCache::getMainWANInstance();
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
$cache->set( $key, $feed, $cache::TTL_DAY );
$cache->set( $timekey, wfTimestamp( TS_MW ), $cache::TTL_DAY );
}
public function loadFromCache( $lastmod, $timekey, $key ) {
global $wgFeedCacheTimeout, $wgOut;
- $cache = ObjectCache::getMainWANInstance();
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
$feedLastmod = $cache->get( $timekey );
if ( ( $wgFeedCacheTimeout > 0 ) && $feedLastmod ) {
/**
* Generate the feed items given a row from the database, printing the feed.
* @param object $rows IDatabase resource with recentchanges rows
- * @param ChannelFeed $feed
+ * @param ChannelFeed &$feed
*/
public static function generateFeed( $rows, &$feed ) {
$items = self::buildItems( $rows );
foreach ( $sorted as $obj ) {
$title = Title::makeTitle( $obj->rc_namespace, $obj->rc_title );
- $talkpage = MWNamespace::canTalk( $obj->rc_namespace )
+ $talkpage = MWNamespace::hasTalkNamespace( $obj->rc_namespace )
? $title->getTalkPage()->getFullURL()
: '';