[ Index ]

PHP Cross Reference of phpwcms V1.4.7 _r403 (01.11.10)

title

Body

[close]

/include/inc_ext/feedcreator/ -> feedcreator.class.php (summary)

Version string.

File Size: 1791 lines (60 kb)
Included or required: 3 times
Referenced: 0 times
Includes or requires: 1 file
 include/inc_ext/feedcreator/feedcreator.class.php

Defines 18 classes

FeedItem:: (0 methods):

EnclosureItem:: (0 methods):

FeedImage:: (0 methods):

HtmlDescribable:: (1 method):
  getDescription()

FeedHtmlField:: (2 methods):
  FeedHtmlField()
  output()

UniversalFeedCreator:: (6 methods):
  _setMIME()
  _setFormat()
  createFeed()
  saveFeed()
  useCached()
  outputFeed()

FeedCreator:: (11 methods):
  addItem()
  iTrunc()
  _createGeneratorComment()
  _createAdditionalElements()
  _createStylesheetReferences()
  createFeed()
  _generateFilename()
  _redirect()
  useCached()
  saveFeed()
  outputFeed()

FeedDate:: (4 methods):
  FeedDate()
  rfc822()
  iso8601()
  unix()

RSSCreator10:: (1 method):
  createFeed()

RSSCreator091:: (3 methods):
  RSSCreator091()
  _setRSSVersion()
  createFeed()

RSSCreator20:: (1 method):
  RSSCreator20()

PIECreator01:: (2 methods):
  PIECreator01()
  createFeed()

AtomCreator10:: (2 methods):
  AtomCreator10()
  createFeed()

AtomCreator03:: (2 methods):
  AtomCreator03()
  createFeed()

MBOXCreator:: (4 methods):
  MBOXCreator()
  qp_enc()
  createFeed()
  _generateFilename()

OPMLCreator:: (2 methods):
  OPMLCreator()
  createFeed()

HTMLCreator:: (2 methods):
  createFeed()
  _generateFilename()

JSCreator:: (2 methods):
  createFeed()
  _generateFilename()


Class: FeedItem  - X-Ref

A FeedItem is a part of a FeedCreator feed.

Class: EnclosureItem  - X-Ref

Class: FeedImage  - X-Ref

An FeedImage may be added to a FeedCreator feed.

Class: HtmlDescribable  - X-Ref

An HtmlDescribable is an item within a feed that can have a description that may
include HTML markup.

getDescription()   X-Ref
Returns a formatted description field, depending on descriptionHtmlSyndicated and
$descriptionTruncSize properties

return: string    the formatted description  

Class: FeedHtmlField  - X-Ref

An FeedHtmlField describes and generates
a feed, item or image html field (probably a description). Output is
generated based on $truncSize, $syndicateHtml properties.

FeedHtmlField($parFieldContent)   X-Ref
Creates a new instance of FeedHtmlField.

param: $string: if given, sets the rawFieldContent property

output()   X-Ref
Creates the right output, depending on $truncSize, $syndicateHtml properties.

return: string    the formatted field

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.

_setMIME($format)   X-Ref
No description

_setFormat($format)   X-Ref
No description

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

param: string    format    format the feed should comply to. Valid values are:
return: string    the contents of the feed.

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 specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()).
param: boolean    displayContents    optional    send the content of the file or not. If true, the file will be sent in the body of the response.

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: 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()).
param: timeout int      optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour)

outputFeed($format='RSS0.91')   X-Ref
Outputs feed to the browser - needed for on-the-fly feed generation (like it is done in WordPress, etc.)

param: format    string    format the feed should comply to. Valid values are:

Class: FeedCreator  - X-Ref

FeedCreator is the abstract base implementation for concrete
implementations that implement a specific format of syndication.

addItem($item)   X-Ref
Adds an FeedItem to the feed.

param: object FeedItem $item The FeedItem to add to the feed.

iTrunc($string, $length)   X-Ref
Truncates a string to a certain length at the most sensible point.
First, if there's a '.' character near the end of the string, the string is truncated after this character.
If there is no '.', the string is truncated after the last ' ' character.
If the string is truncated, " ..." is appended.
If the string is already shorter than $length, it is returned unchanged.

param: string    string A string to be truncated.
param: int        length the maximum length the string should be truncated to
return: string    the truncated string

_createGeneratorComment()   X-Ref
Creates a comment indicating the generator of this feed.
The format of this comment seems to be recognized by
Syndic8.com.


_createAdditionalElements($elements, $indentString="")   X-Ref
Creates a string containing all additional elements specified in
$additionalElements.

param: elements    array    an associative array containing key => value pairs
param: indentString    string    a string that will be inserted before every generated line
return: string    the XML tags corresponding to $additionalElements

_createStylesheetReferences()   X-Ref
No description

createFeed()   X-Ref
Builds the feed's text.

return: string    the feed's complete text

_generateFilename()   X-Ref
Generate a filename for the feed cache file. The result will be $_SERVER["PHP_SELF"] with the extension changed to .xml.
For example:

echo $_SERVER["PHP_SELF"]."\n";
echo FeedCreator::_generateFilename();

would produce:

/rss/latestnews.php
latestnews.xml

return: string the feed cache filename

_redirect($filename)   X-Ref


useCached($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: 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()).
param: timeout    int        optional    the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour)

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

param: 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()).
param: redirect    boolean    optional    send an HTTP redirect header or not. If true, the user will be automatically redirected to the created file.

outputFeed()   X-Ref
Outputs this feed directly to the browser - for on-the-fly feed generation


Class: FeedDate  - X-Ref

FeedDate is an internal class that stores a date for a feed or feed item.
Usually, you won't need to use this.

FeedDate($dateString="")   X-Ref
Creates a new instance of FeedDate representing a given date.
Accepts RFC 822, ISO 8601 date formats as well as unix time stamps.

param: mixed $dateString optional the date this FeedDate will represent. If not specified, the current date and time is used.

rfc822()   X-Ref
Gets the date stored in this FeedDate as an RFC 822 date.

return: a date in RFC 822 format

iso8601()   X-Ref
Gets the date stored in this FeedDate as an ISO 8601 date.

return: a date in ISO 8601 (RFC 3339) format

unix()   X-Ref
Gets the date stored in this FeedDate as unix time stamp.

return: a date as a unix time stamp

Class: RSSCreator10  - X-Ref

RSSCreator10 is a FeedCreator that implements RDF Site Summary (RSS) 1.0.

createFeed()   X-Ref
Builds the RSS feed's text. The feed will be compliant to RDF Site Summary (RSS) 1.0.
The feed will contain all items previously added in the same order.

return: string    the feed's complete text

Class: RSSCreator091  - X-Ref

RSSCreator091 is a FeedCreator that implements RSS 0.91 Spec, revision 3.

RSSCreator091()   X-Ref
Stores this RSS feed's version number.


_setRSSVersion($version)   X-Ref
Sets this RSS feed's version number.


createFeed()   X-Ref
Builds the RSS feed's text. The feed will be compliant to RDF Site Summary (RSS) 1.0.
The feed will contain all items previously added in the same order.

return: string    the feed's complete text

Class: RSSCreator20  - X-Ref

RSSCreator20 is a FeedCreator that implements RDF Site Summary (RSS) 2.0.

RSSCreator20()   X-Ref
No description

Class: PIECreator01  - X-Ref

PIECreator01 is a FeedCreator that implements the emerging PIE specification,
as in http://intertwingly.net/wiki/pie/Syntax.

PIECreator01()   X-Ref
No description

createFeed()   X-Ref
No description

Class: AtomCreator10  - X-Ref

AtomCreator10 is a FeedCreator that implements the atom specification,
as in http://www.atomenabled.org/developers/syndication/atom-format-spec.php
Please note that just by using AtomCreator10 you won't automatically
produce valid atom files. For example, you have to specify either an editor
for the feed or an author for every single feed item.

Some elements have not been implemented yet. These are (incomplete list):
author URL, item author's email and URL, item contents, alternate links,
other link content types than text/html. Some of them may be created with
AtomCreator10::additionalElements.

AtomCreator10()   X-Ref
No description

createFeed()   X-Ref
No description

Class: AtomCreator03  - X-Ref

AtomCreator03 is a FeedCreator that implements the atom specification,
as in http://www.intertwingly.net/wiki/pie/FrontPage.
Please note that just by using AtomCreator03 you won't automatically
produce valid atom files. For example, you have to specify either an editor
for the feed or an author for every single feed item.

Some elements have not been implemented yet. These are (incomplete list):
author URL, item author's email and URL, item contents, alternate links,
other link content types than text/html. Some of them may be created with
AtomCreator03::additionalElements.

AtomCreator03()   X-Ref
No description

createFeed()   X-Ref
No description

Class: MBOXCreator  - X-Ref

MBOXCreator is a FeedCreator that implements the mbox format
as described in http://www.qmail.org/man/man5/mbox.html

MBOXCreator()   X-Ref
No description

qp_enc($input = "", $line_max = 76)   X-Ref
No description

createFeed()   X-Ref
Builds the MBOX contents.

return: string    the feed's complete text

_generateFilename()   X-Ref
Generate a filename for the feed cache file. Overridden from FeedCreator to prevent XML data types.

return: string the feed cache filename

Class: OPMLCreator  - X-Ref

OPMLCreator is a FeedCreator that implements OPML 1.0.

OPMLCreator()   X-Ref
No description

createFeed()   X-Ref
No description

Class: HTMLCreator  - X-Ref

HTMLCreator is a FeedCreator that writes an HTML feed file to a specific
location, overriding the createFeed method of the parent FeedCreator.
The HTML produced can be included over http by scripting languages, or serve
as the source for an IFrame.
All output by this class is embedded in <div></div> tags to enable formatting
using CSS.

createFeed()   X-Ref
Writes the HTML.

return: string    the scripts's complete text

_generateFilename()   X-Ref
Overrrides parent to produce .html extensions

return: string the feed cache filename

Class: JSCreator  - X-Ref

JSCreator is a class that writes a js file to a specific
location, overriding the createFeed method of the parent HTMLCreator.

createFeed()   X-Ref
writes the javascript

return: string    the scripts's complete text

_generateFilename()   X-Ref
Overrrides parent to produce .js extensions

return: string the feed cache filename



Generated: Tue Nov 16 22:51:00 2010 Cross-referenced by PHPXref 0.7