MediaWiki REL1_31
ChangesFeed Class Reference

Feed to Special:RecentChanges and Special:RecentChangesLiked. More...

Public Member Functions

 __construct ( $format, $type)
 
 execute ( $feed, $rows, $lastmod, $opts)
 Generates feed's content.
 
 getFeedObject ( $title, $description, $url)
 Get a ChannelFeed subclass object to use.
 
 loadFromCache ( $lastmod, $timekey, $key)
 Try to load the feed result from cache.
 
 saveToCache ( $feed, $timekey, $key)
 Save to feed result to cache.
 

Static Public Member Functions

static buildItems ( $rows)
 Generate the feed items given a row from the database.
 
static generateFeed ( $rows, &$feed)
 Generate the feed items given a row from the database, printing the feed.
 

Public Attributes

 $descMsg
 
 $format
 
 $titleMsg
 
 $type
 

Detailed Description

Feed to Special:RecentChanges and Special:RecentChangesLiked.

Definition at line 30 of file ChangesFeed.php.

Constructor & Destructor Documentation

◆ __construct()

ChangesFeed::__construct ( $format,
$type )
Parameters
string$formatFeed's format (either 'rss' or 'atom')
string$typeType of feed (for cache keys)

Definition at line 37 of file ChangesFeed.php.

References $format, $type, and type.

Member Function Documentation

◆ buildItems()

static ChangesFeed::buildItems ( $rows)
static

Generate the feed items given a row from the database.

Parameters
object$rowsIDatabase resource with recentchanges rows
Returns
array

Definition at line 185 of file ChangesFeed.php.

References $rows, FeedUtils\formatDiff(), RC_EDIT, RC_EXTERNAL, and wfMessage().

Referenced by ApiFeedRecentChanges\execute(), and generateFeed().

◆ execute()

ChangesFeed::execute ( $feed,
$rows,
$lastmod,
$opts )

Generates feed's content.

Parameters
ChannelFeed$feedChannelFeed subclass object (generally the one returned by getFeedObject())
ResultWrapper$rowsResultWrapper object with rows in recentchanges table
int$lastmodTimestamp of the last item in the recentchanges table (only used for the cache key)
FormOptions$optsAs in SpecialRecentChanges::getDefaultOptions()
Returns
null|bool True or null

Definition at line 78 of file ChangesFeed.php.

References $cache, $rows, $wgLang, $wgRenderHashAppend, FeedUtils\checkFeedOutput(), FeedUtils\checkPurge(), generateFeed(), loadFromCache(), saveToCache(), serialize(), type, and wfDebug().

◆ generateFeed()

static ChangesFeed::generateFeed ( $rows,
& $feed )
static

Generate the feed items given a row from the database, printing the feed.

Parameters
object$rowsIDatabase resource with recentchanges rows
ChannelFeed&$feed

Definition at line 171 of file ChangesFeed.php.

References $rows, and buildItems().

Referenced by execute().

◆ getFeedObject()

ChangesFeed::getFeedObject ( $title,
$description,
$url )

Get a ChannelFeed subclass object to use.

Parameters
string$titleFeed's title
string$descriptionFeed's description
string$urlUrl of origin page
Returns
ChannelFeed|bool ChannelFeed subclass or false on failure

Definition at line 50 of file ChangesFeed.php.

References $format, $wgFeedClasses, $wgLanguageCode, and $wgSitename.

◆ loadFromCache()

ChangesFeed::loadFromCache ( $lastmod,
$timekey,
$key )

Try to load the feed result from cache.

Parameters
int$lastmodTimestamp of the last item in the recentchanges table
string$timekeyMemcached key of the last modification
string$keyMemcached key of the content
Returns
string|bool Feed's content on cache hit or false on cache miss

Definition at line 135 of file ChangesFeed.php.

References $cache, $wgFeedCacheTimeout, $wgOut, wfDebug(), and wfTimestamp().

Referenced by execute().

◆ saveToCache()

ChangesFeed::saveToCache ( $feed,
$timekey,
$key )

Save to feed result to cache.

Parameters
string$feedFeed's content
string$timekeyMemcached key of the last modification
string$keyMemcached key of the content

Definition at line 121 of file ChangesFeed.php.

References $cache, and wfTimestamp().

Referenced by execute().

Member Data Documentation

◆ $descMsg

ChangesFeed::$descMsg

Definition at line 31 of file ChangesFeed.php.

◆ $format

ChangesFeed::$format

Definition at line 31 of file ChangesFeed.php.

Referenced by __construct(), and getFeedObject().

◆ $titleMsg

ChangesFeed::$titleMsg

Definition at line 31 of file ChangesFeed.php.

◆ $type

ChangesFeed::$type

Definition at line 31 of file ChangesFeed.php.

Referenced by __construct().


The documentation for this class was generated from the following file: