Class UniversalFeedCreator

Description

UniversalFeedCreator lets you choose during runtime which format to build.

For general usage of a feed class, see the FeedCreator class below or the example above.

Located in /includes/feedcreator.class.php (line 273)

HtmlDescribable
   |
   --FeedCreator
      |
      --UniversalFeedCreator
Variable Summary
mixed $_feed
Method Summary
string createFeed ([string $format = "RSS0.91"])
void outputFeed ([format $format = 'RSS0.91'])
void saveFeed ([string $format = "RSS0.91"], [string $filename = ""], [boolean $displayContents = true])
void useCached ([string $format = "RSS0.91"], [filename $filename = ""], [timeout $timeout = 3600])
void _setFormat ( $format)
void _setMIME ()
Variables
Methods
createFeed (line 363)

Creates a syndication feed based on the items previously added.

string createFeed ([string $format = "RSS0.91"])
  • string $format: format format the feed should comply to. Valid values are: "PIE0.1", "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3", "HTML", "JS"

Redefinition of:
FeedCreator::createFeed()
Builds the feed's text.
outputFeed (line 410)

Outputs feed to the browser - needed for on-the-fly feed generation (like it is done in WordPress, etc.)

void outputFeed ([format $format = 'RSS0.91'])
  • format $format: string format the feed should comply to. Valid values are: "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3".

Redefinition of:
FeedCreator::outputFeed()
Outputs this feed directly to the browser - for on-the-fly feed generation
saveFeed (line 380)

Saves this feed as a file on the local disk. After the file is saved, an HTTP redirect header may be sent to redirect the use to the newly created file.

  • since: 1.4
void saveFeed ([string $format = "RSS0.91"], [string $filename = ""], [boolean $displayContents = true])
  • string $format: format format the feed should comply to. Valid values are: "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM", "ATOM0.3", "HTML", "JS"
  • string $filename: filename optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()).
  • boolean $displayContents: displayContents optional send the content of the file or not. If true, the file will be sent in the body of the response.

Redefinition of:
FeedCreator::saveFeed()
Saves this feed as a file on the local disk. After the file is saved, a redirect header may be sent to redirect the user to the newly created file.
useCached (line 398)

Turns on caching and checks if there is a recent version of this feed in the cache.

If there is, an HTTP redirect header is sent. To effectively use caching, you should create the FeedCreator object and call this method before anything else, especially before you do the time consuming task to build the feed (web fetching, for example).

void useCached ([string $format = "RSS0.91"], [filename $filename = ""], [timeout $timeout = 3600])
  • string $format: format format the feed should comply to. Valid values are: "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3".
  • filename $filename: string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()).
  • timeout $timeout: int optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour)

Redefinition of:
FeedCreator::useCached()
Turns on caching and checks if there is a recent version of this feed in the cache.
_setFormat (line 285)
void _setFormat ( $format)
  • $format
_setMIME (line 276)
void _setMIME ()

Inherited Methods

Inherited From FeedCreator

FeedCreator::addItem()
FeedCreator::addNamespace()
FeedCreator::createFeed()
FeedCreator::iTrunc()
FeedCreator::outputFeed()
FeedCreator::saveFeed()
FeedCreator::setEncoding()
FeedCreator::useCached()
FeedCreator::version()
FeedCreator::_createAdditionalElements()
FeedCreator::_createGeneratorComment()
FeedCreator::_createNamespace()
FeedCreator::_createStylesheetReferences()

Inherited From HtmlDescribable

HtmlDescribable::getDescription()

Documentation generated on Wed, 28 Mar 2007 09:54:16 -0600 by phpDocumentor 1.3.1