MediaWiki  master
ChannelFeed Class Reference

Class to support the outputting of syndication feeds in Atom and RSS format. More...

Inheritance diagram for ChannelFeed:
Collaboration diagram for ChannelFeed:

Public Member Functions

 __construct ( $title, $description, $url, $date='', $author='', $comments='')
 
 httpHeaders ()
 Setup and send HTTP headers. More...
 
 outFooter ()
 Generate Footer of the feed. More...
 
 outHeader ()
 Generate Header of the feed. More...
 
 outItem ( $item)
 Generate an item. More...
 
- Public Member Functions inherited from FeedItem
 __construct ( $title, $description, $url, $date='', $author='', $comments='')
 
 getAuthor ()
 Get the author of this item; already xml-encoded. More...
 
 getAuthorUnescaped ()
 Get the author of this item without any escaping. More...
 
 getComments ()
 Get the comment of this item; already xml-encoded. More...
 
 getCommentsUnescaped ()
 Get the comment of this item without any escaping. More...
 
 getDate ()
 Get the date of this item. More...
 
 getDescription ()
 Get the description of this item; already xml-encoded. More...
 
 getDescriptionUnescaped ()
 Get the description of this item without any escaping. More...
 
 getLanguage ()
 Get the language of this item. More...
 
 getTitle ()
 Get the title of this item; already xml-encoded. More...
 
 getUniqueID ()
 Get the unique id of this item; already xml-encoded. More...
 
 getUniqueIdUnescaped ()
 Get the unique id of this item, without any escaping. More...
 
 getUrl ()
 Get the URL of this item; already xml-encoded. More...
 
 getUrlUnescaped ()
 Get the URL of this item without any escaping. More...
 
 setUniqueId ( $uniqueId, $rssIsPermalink=false)
 Set the unique id of an item. More...
 
 xmlEncode ( $string)
 Encode $string so that it can be safely embedded in a XML document. More...
 

Protected Member Functions

 outXmlHeader ()
 Output the initial XML headers. More...
 

Protected Attributes

TemplateParser $templateParser
 

Private Member Functions

 contentType ()
 Return an internet media type to be sent in the headers. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from FeedItem
static stripComment ( $text)
 Quickie hack... More...
 
- Public Attributes inherited from FeedItem
 $author
 
 $comments
 
 $date
 
 $description
 
 $rssIsPermalink = false
 
Title $title
 
 $uniqueId
 
 $url
 

Detailed Description

Class to support the outputting of syndication feeds in Atom and RSS format.

Definition at line 29 of file ChannelFeed.php.

Constructor & Destructor Documentation

◆ __construct()

ChannelFeed::__construct (   $title,
  $description,
  $url,
  $date = '',
  $author = '',
  $comments = '' 
)
Parameters
string | Title$titleFeed's title
string$description
string$urlURL uniquely designating the feed.
string$dateFeed's date
string$authorAuthor's user name
string$comments

Definition at line 42 of file ChannelFeed.php.

References FeedItem\$author, FeedItem\$comments, FeedItem\$date, FeedItem\$description, FeedItem\$title, FeedItem\$url, outFooter(), outHeader(), and outItem().

Member Function Documentation

◆ contentType()

ChannelFeed::contentType ( )
private

Return an internet media type to be sent in the headers.

Returns
string

Definition at line 108 of file ChannelFeed.php.

References $wgRequest.

Referenced by httpHeaders().

◆ httpHeaders()

ChannelFeed::httpHeaders ( )

Setup and send HTTP headers.

Don't send any content; content might end up being cached and re-sent with these same headers later.

This should be called from the outHeader() method, but can also be called separately.

Definition at line 83 of file ChannelFeed.php.

References $ext, $wgOut, $wgVaryOnXFP, contentType(), and MediaWiki\MediaWikiServices\getInstance().

Referenced by outXmlHeader().

◆ outFooter()

ChannelFeed::outFooter ( )
abstract

Generate Footer of the feed.

Example:
print "</feed>";

Referenced by __construct().

◆ outHeader()

ChannelFeed::outHeader ( )
abstract

Generate Header of the feed.

Example:
print "<feed>";

Referenced by __construct().

◆ outItem()

ChannelFeed::outItem (   $item)
abstract

Generate an item.

Example:
print "<item>...</item>";
Parameters
FeedItem$item

Referenced by __construct().

◆ outXmlHeader()

ChannelFeed::outXmlHeader ( )
protected

Output the initial XML headers.

Definition at line 125 of file ChannelFeed.php.

References httpHeaders().

Referenced by AtomFeed\outHeader(), and RSSFeed\outHeader().

Member Data Documentation

◆ $templateParser

TemplateParser ChannelFeed::$templateParser
protected

Definition at line 32 of file ChannelFeed.php.


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