FeedUtils Class Reference
[Feed]

Helper functions for feeds. More...

List of all members.

Static Public Member Functions

static checkPurge ($timekey, $key)
 Check whether feed's cache should be cleared; for changes feeds If the feed should be purged; $timekey and $key will be removed from $messageMemc.
static checkFeedOutput ($type)
 Check whether feeds can be used and that $type is a valid feed type.
static formatDiff ($row)
 Format a diff for the newsfeed.
static formatDiffRow ($title, $oldid, $newid, $timestamp, $comment, $actiontext='')
 Really format a diff for the newsfeed.
static applyDiffStyle ($text)
 Hacky application of diff styles for the feeds.


Detailed Description

Helper functions for feeds.

Definition at line 8 of file FeedUtils.php.


Member Function Documentation

static FeedUtils::applyDiffStyle ( text  )  [static]

Hacky application of diff styles for the feeds.

Might be 'cleaner' to use DOM or XSLT or something, but *gack* it's a pain in the ass.

Parameters:
$text String: diff's HTML output
Returns:
String: modified HTML
Access:
private

Definition at line 172 of file FeedUtils.php.

Referenced by formatDiffRow().

static FeedUtils::checkFeedOutput ( type  )  [static]

Check whether feeds can be used and that $type is a valid feed type.

Parameters:
$type String: feed type, as requested by the user
Returns:
Boolean

Definition at line 33 of file FeedUtils.php.

References $wgFeed, $wgFeedClasses, $wgOut, and wfHttpError().

Referenced by ChangesFeed::execute(), and HistoryPage::feed().

static FeedUtils::checkPurge ( timekey,
key 
) [static]

Check whether feed's cache should be cleared; for changes feeds If the feed should be purged; $timekey and $key will be removed from $messageMemc.

Parameters:
$timekey String: cache key of the timestamp of the last item
$key String: cache key of feed's content

Definition at line 18 of file FeedUtils.php.

References $messageMemc, $purge, $wgRequest, and $wgUser.

Referenced by ChangesFeed::execute().

static FeedUtils::formatDiff ( row  )  [static]

Format a diff for the newsfeed.

Parameters:
$row Object: row from the recentchanges table
Returns:
String

Definition at line 56 of file FeedUtils.php.

References $wgUser, LogPage::actionText(), LogPage::DELETED_ACTION, Revision::DELETED_COMMENT, LogPage::extractParams(), formatDiffRow(), Title::makeTitle(), wfMsgHtml(), and wfTimestamp().

Referenced by ChangesFeed::generateFeed().

static FeedUtils::formatDiffRow ( title,
oldid,
newid,
timestamp,
comment,
actiontext = '' 
) [static]

Really format a diff for the newsfeed.

Parameters:
$title Title object
$oldid Integer: old revision's id
$newid Integer: new revision's id
$timestamp Integer: new revision's timestamp
$comment String: new revision's comment
$actiontext String: text of the action; in case of log event
Returns:
String

Definition at line 88 of file FeedUtils.php.

References $title, $wgContLang, $wgFeedDiffCutoff, $wgUser, applyDiffStyle(), UtfNormal::cleanUp(), Revision::newFromId(), wfMsg(), wfMsgForContent(), wfProfileIn(), and wfProfileOut().

Referenced by HistoryPage::feedItem(), and formatDiff().


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

Generated on Sat Apr 30 22:57:37 2011 for MediaWiki by  doxygen 1.5.9