MediaWiki  1.23.2
ChangesFeed Class Reference

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

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

 $descMsg
 
 $format
 
 $titleMsg
 
 $type
 

Detailed Description

Feed to Special:RecentChanges and Special:RecentChangesLiked.

Definition at line 28 of file ChangesFeed.php.

Constructor & Destructor Documentation

◆ __construct()

ChangesFeed::__construct (   $format,
  $type 
)

Constructor.

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, format, and type.

Member Function Documentation

◆ buildItems()

static ChangesFeed::buildItems (   $rows)
static

Generate the feed items given a row from the database.

Parameters
$rowsDatabaseBase resource with recentchanges rows

Definition at line 184 of file ChangesFeed.php.

References $n, $title, array(), as, MWNamespace\canTalk(), Revision\DELETED_USER, FeedUtils\formatDiff(), Title\makeTitle(), RC_EDIT, wfMessage(), wfProfileIn(), and wfProfileOut().

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 $wgLang, FeedUtils\checkFeedOutput(), FeedUtils\checkPurge(), format, generateFeed(), global, loadFromCache(), saveToCache(), type, wfDebug(), and wfMemcKey().

◆ generateFeed()

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

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

Parameters
$rowsDatabaseBase resource with recentchanges rows
$feedFeed object

Definition at line 169 of file ChangesFeed.php.

References as, buildItems(), wfProfileIn(), and wfProfileOut().

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 subclass or false on failure

Definition at line 50 of file ChangesFeed.php.

References $format, format, and global.

◆ loadFromCache()

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

Try to load the feed result from $messageMemc.

Parameters
$lastmodInteger: timestamp 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 134 of file ChangesFeed.php.

References $messageMemc, $wgOut, global, TS_UNIX, wfDebug(), and wfTimestamp().

Referenced by execute().

◆ saveToCache()

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

Save to feed result to $messageMemc.

Parameters
string$feedfeed's content
string$timekeymemcached key of the last modification
string$keymemcached key of the content

Definition at line 119 of file ChangesFeed.php.

References $messageMemc, global, TS_MW, and wfTimestamp().

Referenced by execute().

Member Data Documentation

◆ $descMsg

ChangesFeed::$descMsg

Definition at line 29 of file ChangesFeed.php.

◆ $format

ChangesFeed::$format

Definition at line 29 of file ChangesFeed.php.

Referenced by __construct(), and getFeedObject().

◆ $titleMsg

ChangesFeed::$titleMsg

Definition at line 29 of file ChangesFeed.php.

◆ $type

ChangesFeed::$type

Definition at line 29 of file ChangesFeed.php.

Referenced by __construct().


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