MediaWiki  REL1_19
FeedUtils Class Reference

Helper functions for feeds. More...

List of all members.

Static Public Member Functions

static applyDiffStyle ($text)
 Hacky application of diff styles for the feeds.
static checkFeedOutput ($type)
 Check whether feeds can be used and that $type is a valid feed type.
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 formatDiff ($row)
 Format a diff for the newsfeed.
static formatDiffRow ($title, $oldid, $newid, $timestamp, $comment, $actiontext='')
 Really format a diff for the newsfeed.

Static Protected Member Functions

static getDiffLink (Title $title, $newid, $oldid=null)
 Generates a diff link.

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:
$textString: diff's HTML output
Returns:
String: modified HTML

Definition at line 189 of file FeedUtils.php.

Referenced by formatDiffRow().

Here is the caller graph for this function:

static FeedUtils::checkFeedOutput ( type) [static]

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

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

Definition at line 33 of file FeedUtils.php.

References $wgFeed, $wgFeedClasses, and $wgOut.

Referenced by ChangesFeed\execute(), and HistoryAction\feed().

Here is the caller graph for this function:

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:
$timekeyString: cache key of the timestamp of the last item
$keyString: cache key of feed's content

Definition at line 18 of file FeedUtils.php.

References $messageMemc, and $wgUser.

Referenced by ChangesFeed\execute().

Here is the caller graph for this function:

static FeedUtils::formatDiff ( row) [static]

Format a diff for the newsfeed.

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

Definition at line 55 of file FeedUtils.php.

References Revision\DELETED_COMMENT, formatDiffRow(), Title\makeTitle(), LogFormatter\newFromRow(), wfMsgHtml(), and wfTimestamp().

Referenced by ChangesFeed\generateFeed().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Really format a diff for the newsfeed.

Parameters:
$titleTitle object
$oldidInteger: old revision's id
$newidInteger: new revision's id
$timestampInteger: new revision's timestamp
$commentString: new revision's comment
$actiontextString: text of the action; in case of log event
Returns:
String

Definition at line 84 of file FeedUtils.php.

References $comment, $title, $wgFeedDiffCutoff, $wgLang, applyDiffStyle(), UtfNormal\cleanUp(), Linker\formatComment(), getDiffLink(), Revision\newFromId(), wfMsg(), wfProfileIn(), and wfProfileOut().

Referenced by HistoryAction\feedItem(), and formatDiff().

Here is the call graph for this function:

Here is the caller graph for this function:

static FeedUtils::getDiffLink ( Title title,
newid,
oldid = null 
) [static, protected]

Generates a diff link.

Used when the full diff is not wanted for example when $wgFeedDiffCutoff is 0.

Parameters:
$titleTitle object: used to generate the diff URL
$newidInteger newid for this diff
$oldidInteger|null oldid for the diff. Null means it is a new article

Definition at line 169 of file FeedUtils.php.

References Html\element(), and wfMsgForContent().

Referenced by formatDiffRow().

Here is the call graph for this function:

Here is the caller graph for this function:


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