MediaWiki
1.23.2
|
Helper functions for feeds. More...
Static Public Member Functions | |
static | applyDiffStyle ( $text) |
Hacky application of diff styles for the feeds. More... | |
static | checkFeedOutput ( $type) |
Check whether feeds can be used and that $type is a valid feed type. More... | |
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. More... | |
static | formatDiff ( $row) |
Format a diff for the newsfeed. More... | |
static | formatDiffRow ( $title, $oldid, $newid, $timestamp, $comment, $actiontext='') |
Really format a diff for the newsfeed. More... | |
Static Protected Member Functions | |
static | getDiffLink (Title $title, $newid, $oldid=null) |
Generates a diff link. More... | |
Helper functions for feeds.
Definition at line 29 of file FeedUtils.php.
|
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.
string | $text | diff's HTML output |
Definition at line 243 of file FeedUtils.php.
Referenced by formatDiffRow().
|
static |
Check whether feeds can be used and that $type is a valid feed type.
string | $type | feed type, as requested by the user |
Definition at line 54 of file FeedUtils.php.
References $type, $wgOut, and global.
Referenced by ChangesFeed\execute(), and HistoryAction\feed().
|
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.
string | $timekey | cache key of the timestamp of the last item |
string | $key | cache key of feed's content |
Definition at line 39 of file FeedUtils.php.
References $messageMemc, $wgUser, and global.
Referenced by ChangesFeed\execute().
|
static |
Format a diff for the newsfeed.
$row | Object: row from the recentchanges table |
Definition at line 76 of file FeedUtils.php.
References $timestamp, array(), Revision\DELETED_COMMENT, formatDiffRow(), Title\makeTitle(), LogFormatter\newFromRow(), RC_LOG, TS_MW, wfMessage(), and wfTimestamp().
Referenced by ChangesFeed\buildItems().
|
static |
Really format a diff for the newsfeed.
$title | Title object | |
$oldid | Integer: old revision's id | |
$newid | Integer: new revision's id | |
$timestamp | Integer: new revision's timestamp | |
string | $comment | new revision's comment |
string | $actiontext | text of the action; in case of log event |
Definition at line 105 of file FeedUtils.php.
References $comment, $html, $rev, $timestamp, $title, $wgLang, applyDiffStyle(), array(), UtfNormal\cleanUp(), Linker\formatComment(), getDiffLink(), ContentHandler\getForTitle(), RequestContext\getMain(), global, Revision\newFromId(), text, User, wfMessage(), wfProfileIn(), and wfProfileOut().
Referenced by HistoryAction\feedItem(), and formatDiff().
|
staticprotected |
Generates a diff link.
Used when the full diff is not wanted for example when $wgFeedDiffCutoff is 0.
$title | Title object: used to generate the diff URL |
$newid | Integer newid for this diff |
$oldid | Integer|null oldid for the diff. Null means it is a new article |
Definition at line 222 of file FeedUtils.php.
References $title, array(), Html\element(), text, and wfMessage().
Referenced by formatDiffRow().