MediaWiki REL1_37
AtomFeed Class Reference

Generate an Atom feed. More...

Inheritance diagram for AtomFeed:
Collaboration diagram for AtomFeed:

Public Member Functions

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

Private Member Functions

 formatTime ( $timestamp)
 Format a date given timestamp, if one is given.
 
 getFeedId ()
 Atom 1.0 requires a unique, opaque IRI as a unique identifier for every feed we create.
 
 getSelfUrl ()
 Atom 1.0 requests a self-reference to the feed.
 

Additional Inherited Members

- Static Public Member Functions inherited from FeedItem
static stripComment ( $text)
 Quickie hack... strip out wikilinks to more legible form from the comment.
 
- Public Attributes inherited from FeedItem
 $author
 
 $comments
 
 $date
 
 $description
 
 $rssIsPermalink = false
 
Title $title
 
 $uniqueId
 
 $url
 
- Protected Member Functions inherited from ChannelFeed
 outXmlHeader ()
 Output the initial XML headers.
 
- Protected Attributes inherited from ChannelFeed
TemplateParser $templateParser
 

Detailed Description

Generate an Atom feed.

Definition at line 29 of file AtomFeed.php.

Member Function Documentation

◆ formatTime()

AtomFeed::formatTime (   $timestamp)
private

Format a date given timestamp, if one is given.

Parameters
string | int | null$timestamp
Returns
string|null

Definition at line 36 of file AtomFeed.php.

References wfTimestamp().

Referenced by outHeader(), and outItem().

◆ getFeedId()

AtomFeed::getFeedId ( )
private

Atom 1.0 requires a unique, opaque IRI as a unique identifier for every feed we create.

For now just use the URL, but who can tell if that's right? If we put options on the feed, do we have to change the id? Maybe? Maybe not.

Returns
string

Definition at line 72 of file AtomFeed.php.

References getSelfUrl().

Referenced by outHeader().

◆ getSelfUrl()

AtomFeed::getSelfUrl ( )
private

Atom 1.0 requests a self-reference to the feed.

Returns
string

Definition at line 80 of file AtomFeed.php.

References $wgRequest.

Referenced by getFeedId(), and outHeader().

◆ outFooter()

AtomFeed::outFooter ( )

Outputs the footer for Atom 1.0 feed (basically '\</feed\>').

Reimplemented from ChannelFeed.

Definition at line 108 of file AtomFeed.php.

References print.

◆ outHeader()

◆ outItem()

AtomFeed::outItem (   $item)

Output a given item.

Parameters
FeedItem$item

Reimplemented from ChannelFeed.

Definition at line 89 of file AtomFeed.php.

References $wgMimeType, formatTime(), print, PROTO_CURRENT, wfExpandUrl(), and FeedItem\xmlEncode().


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