[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/vendor/openpsa/universalfeedcreator/lib/ -> UniversalFeedCreator.php (summary)

(no description)

File Size: 160 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

UniversalFeedCreator:: (4 methods):
  _setFormat()
  createFeed()
  saveFeed()
  useCached()


Class: UniversalFeedCreator  - X-Ref

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.

_setFormat($format)   X-Ref

param: string $format

createFeed($format = "RSS0.91")   X-Ref
Creates a syndication feed based on the items previously added.

return: string the contents of the feed.
see: FeedCreator::addItem()
param: string $format format the feed should comply to. Valid values are:

saveFeed($format = "RSS0.91", $filename = "", $displayContents = true)   X-Ref
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.

param: string $format           format the feed should comply to. Valid values are:
param: string $filename         optional    the filename where a recent version of the feed is saved. If not
param: boolean $displayContents optional    send the content of the file or not. If true, the file will be sent

useCached($format = "RSS0.91", $filename = "", $timeout = 3600)   X-Ref
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).

param: string $format   format the feed should comply to. Valid values are:
param: string $filename optional the filename where a recent version of the feed is saved. If not specified, the
param: int $timeout     optional the timeout in seconds before a cached version is refreshed (defaults to 3600 =