rss
[ class tree: rss ] [ index: rss ] [ all elements ]

Class: FeedCreator

Source Location: d:\website\PhpDocumentor\/rss/feedcreator.class.php

Class Overview

HtmlDescribable
   |
   --FeedCreator



Author(s):

Variables

Methods


Child classes:

Inherited Variables

Inherited Methods

Class: HtmlDescribable

HtmlDescribable::getDescription()
Returns a formatted description field, depending on descriptionHtmlSyndicated and

Class Details

[line 415]


Tags:

since:  1.4
author:  Kai Blankenhorn <kaib@bitfolge.de>
abstract:  


[ Top ]


Class Variables

$additionalElements = array()

[line 464]

Any additional elements to include as an assiciated array. All $key => $value pairs

will be included unencoded in the feed in the form <$key>$value</$key> Again: No encoding will be used! This means you can invalidate or enhance the feed if $value contains markup. This may be abused to embed tags not implemented by the FeedCreator class used.



Type:   mixed


[ Top ]

$category =

[line 426]


Type:   mixed


[ Top ]

$copyright =

[line 426]


Type:   mixed


[ Top ]

$description =

[line 420]


Type:   mixed


[ Top ]

$docs =

[line 426]


Type:   mixed


[ Top ]

$editor =

[line 426]


Type:   mixed


[ Top ]

$editorEmail =

[line 426]


Type:   mixed


[ Top ]

$encoding =  "UTF-8"

[line 453]

This feed's character encoding.



Tags:

since:  1.6.1

Type:   mixed


[ Top ]

$image =

[line 426]


Type:   mixed


[ Top ]

$language =

[line 426]


Type:   mixed


[ Top ]

$lastBuildDate =

[line 426]


Type:   mixed


[ Top ]

$link =

[line 420]


Type:   mixed


[ Top ]

$pubDate =

[line 426]


Type:   mixed


[ Top ]

$rating =

[line 426]


Type:   mixed


[ Top ]

$skipDays =

[line 426]


Type:   mixed


[ Top ]

$skipHours =

[line 426]


Type:   mixed


[ Top ]

$syndicationURL =

[line 426]

Optional attributes of a feed.


Type:   mixed


[ Top ]

$title =

[line 420]

Mandatory attributes of a feed.


Type:   mixed


[ Top ]

$ttl =

[line 426]


Type:   mixed


[ Top ]

$webmaster =

[line 426]


Type:   mixed


[ Top ]

$xslStyleSheet =  ""

[line 432]

The url of the external xsl stylesheet used to format the naked rss feed.

Ignored in the output when empty.



Type:   mixed


[ Top ]



Class Methods


static method iTrunc [line 490]

static string iTrunc( string $string, int $length)

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.




Tags:

return:  the truncated string


Parameters:

string   $string   string A string to be truncated.
int   $length   length the maximum length the string should be truncated to

[ Top ]

method addItem [line 473]

void addItem( object FeedItem $item)

Adds an FeedItem to the feed.



Tags:

access:  public


Parameters:

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

[ Top ]

method createFeed [line 562]

string createFeed( )

Builds the feed's text.



Tags:

return:  the feed's complete text
abstract:  


Overridden in child classes as:

UniversalFeedCreator::createFeed()
Creates a syndication feed based on the items previously added.
RSSCreator10::createFeed()
Builds the RSS feed's text. The feed will be compliant to RDF Site Summary (RSS) 1.0.
RSSCreator091::createFeed()
Builds the RSS feed's text. The feed will be compliant to RDF Site Summary (RSS) 1.0.
PIECreator01::createFeed()
AtomCreator03::createFeed()
MBOXCreator::createFeed()
Builds the MBOX contents.
OPMLCreator::createFeed()
HTMLCreator::createFeed()
Writes the HTML.
JSCreator::createFeed()
writes the javascript

[ Top ]

method saveFeed [line 640]

void saveFeed( [filename $filename = ""], [redirect $displayContents = true])

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.



Tags:

since:  1.4


Overridden in child classes as:

UniversalFeedCreator::saveFeed()
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.

Parameters:

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

[ Top ]

method useCached [line 621]

void useCached( [filename $filename = ""], [timeout $timeout = 3600])

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).




Tags:

since:  1.4


Overridden in child classes as:

UniversalFeedCreator::useCached()
Turns on caching and checks if there is a recent version of this feed in the cache.

Parameters:

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)

[ Top ]

method _createAdditionalElements [line 535]

string _createAdditionalElements( elements $elements, [indentString $indentString = ""])

Creates a string containing all additional elements specified in $additionalElements.



Tags:

return:  the XML tags corresponding to $additionalElements


Parameters:

elements   $elements   array an associative array containing key => value pairs
indentString   $indentString   string a string that will be inserted before every generated line

[ Top ]

method _createGeneratorComment [line 523]

void _createGeneratorComment( )

Creates a comment indicating the generator of this feed.

The format of this comment seems to be recognized by Syndic8.com.




[ Top ]

method _createStylesheetReferences [line 545]

void _createStylesheetReferences( )



[ Top ]


Documentation generated on Thu, 15 Feb 2007 20:39:08 +0000 by phpDocumentor 1.3.0