X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FFeedUtils.php;h=bfd1e2a6cdc493ad5a151d8835859dab37beaa74;hb=e1724b7a10be582ea6d53e94fa2a6e8339d0df9f;hp=0a88b2345fb92dc0539a2a9fe77c0efb7d02274a;hpb=c7b0bb2459a6b14590b252935eccc2edfccae13b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index 0a88b2345f..bfd1e2a6cd 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -20,7 +20,8 @@ * @file * @ingroup Feed */ -use MediaWiki\MediaWikiServices; + +use MediaWiki\Revision\RevisionRecord; /** * Helper functions for feeds @@ -29,25 +30,6 @@ use MediaWiki\MediaWikiServices; */ class FeedUtils { - /** - * Check whether feed's cache should be cleared; for changes feeds - * If the feed should be purged; $timekey and $key will be removed from cache - * - * @param string $timekey Cache key of the timestamp of the last item - * @param string $key Cache key of feed's content - */ - public static function checkPurge( $timekey, $key ) { - global $wgRequest, $wgUser; - - $purge = $wgRequest->getVal( 'action' ) === 'purge'; - // Allow users with 'purge' right to clear feed caches - if ( $purge && $wgUser->isAllowed( 'purge' ) ) { - $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); - $cache->delete( $timekey, 1 ); - $cache->delete( $key, 1 ); - } - } - /** * Check whether feeds can be used and that $type is a valid feed type * @@ -88,7 +70,7 @@ class FeedUtils { return self::formatDiffRow( $titleObj, $row->rc_last_oldid, $row->rc_this_oldid, $timestamp, - $row->rc_deleted & Revision::DELETED_COMMENT + $row->rc_deleted & RevisionRecord::DELETED_COMMENT ? wfMessage( 'rev-deleted-comment' )->escaped() : CommentStore::getStore()->getComment( 'rc_comment', $row )->text, $actiontext