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

Class: FeedCreator

Source Location: /FeedCreator.php

Class Overview

HtmlDescribable
   |
   --FeedCreator

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


Author(s):

Variables

Methods


Child classes:

UniversalFeedCreator
UniversalFeedCreator lets you choose during runtime which format to build.
RSSCreator10
RSSCreator10 is a FeedCreator that implements RDF Site Summary (RSS) 1.0.
RSSCreator091
RSSCreator091 is a FeedCreator that implements RSS 0.91 Spec, revision 3.
PIECreator01
PIECreator01 is a FeedCreator that implements the emerging PIE specification, as in http://intertwingly.net/wiki/pie/Syntax.
AtomCreator10
AtomCreator10 is a FeedCreator that implements the atom specification,
AtomCreator03
AtomCreator03 is a FeedCreator that implements the atom specification, as in http://www.intertwingly.net/wiki/pie/FrontPage.
MBOXCreator
MBOXCreator is a FeedCreator that implements the mbox format as described in http://www.qmail.org/man/man5/mbox.html
OPMLCreator
OPMLCreator is a FeedCreator that implements OPML 1.0.
HTMLCreator
HTMLCreator is a FeedCreator that writes an HTML feed file to a specific location, overriding the createFeed method of the parent FeedCreator.

Inherited Variables

Inherited Methods

Class: HtmlDescribable

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

Class Details

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



Tags:

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


[ Top ]


Class Variables

$additionalElements = array()

[line 643]

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 599]


Type:   mixed


[ Top ]

$contentType =  "application/xml"

[line 625]

This feed's MIME content type.



Tags:

since:  1.4
access:  private

Type:   mixed


[ Top ]

$copyright =

[line 599]


Type:   mixed


[ Top ]

$cssStyleSheet =  ""

[line 605]

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

Ignored in the output when empty.



Type:   mixed


[ Top ]

$description =

[line 593]


Type:   mixed


[ Top ]

$docs =

[line 599]


Type:   mixed


[ Top ]

$editor =

[line 599]


Type:   mixed


[ Top ]

$editorEmail =

[line 599]


Type:   mixed


[ Top ]

$encoding =  "ISO-8859-1"

[line 632]

This feed's character encoding.



Tags:

since:  1.6.1

Type:   mixed


[ Top ]

$image =

[line 599]


Type:   mixed


[ Top ]

$items = array()

[line 617]



Tags:

access:  private

Type:   mixed


[ Top ]

$language =

[line 599]


Type:   mixed


[ Top ]

$lastBuildDate =

[line 599]


Type:   mixed


[ Top ]

$link =

[line 593]


Type:   mixed


[ Top ]

$pubDate =

[line 599]


Type:   mixed


[ Top ]

$rating =

[line 599]


Type:   mixed


[ Top ]

$skipDays =

[line 599]


Type:   mixed


[ Top ]

$skipHours =

[line 599]


Type:   mixed


[ Top ]

$syndicationURL =

[line 599]

Optional attributes of a feed.


Type:   mixed


[ Top ]

$title =

[line 593]

Mandatory attributes of a feed.


Type:   mixed


[ Top ]

$ttl =

[line 599]


Type:   mixed


[ Top ]

$webmaster =

[line 599]


Type:   mixed


[ Top ]

$xslStyleSheet =  ""

[line 611]

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 669]

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 652]

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 737]

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()
AtomCreator10::createFeed()
AtomCreator03::createFeed()
MBOXCreator::createFeed()
Builds the MBOX contents.
OPMLCreator::createFeed()
HTMLCreator::createFeed()
Writes the HTML.
JSCreator::createFeed()
writes the javascript

[ Top ]

method outputFeed [line 837]

void outputFeed( )

Outputs this feed directly to the browser - for on-the-fly feed generation



Tags:

since:  

1.7.2-mod

still missing: proper header output - currently you have to add it manually



Overridden in child classes as:

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

[ Top ]

method saveFeed [line 815]

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 796]

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 714]

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 702]

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 724]

void _createStylesheetReferences( )



[ Top ]

method _generateFilename [line 756]

string _generateFilename( )

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




Tags:

return:  the feed cache filename
since:  1.4
access:  private


Overridden in child classes as:

MBOXCreator::_generateFilename()
Generate a filename for the feed cache file. Overridden from FeedCreator to prevent XML data types.
HTMLCreator::_generateFilename()
Overrrides parent to produce .html extensions
JSCreator::_generateFilename()
Overrrides parent to produce .js extensions

[ Top ]

method _redirect [line 766]

void _redirect( $filename)



Tags:

since:  1.4
access:  private


Parameters:

   $filename  

[ Top ]


Documentation generated on Mon, 28 May 2007 16:15:01 +0200 by phpDocumentor 1.3.2