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

Class: FeedParserBase

Source Location: /system/classes/syndication/feedparserbase.class.php

Class Overview


FeedParserBase provides an abstract ancestor class for feed parsers.


Author(s):

  • Michael Jervis (mike@fuckingbrit.com)

Copyright:

  • Michael Jervis 2004

Variables

Constants

Methods


Child classes:

Atom10
atom10 provides reading and writing of Atom 1.0 format syndication feeds.
RDF
RDF provides reading and writing of RDF 1.0 format syndication feeds.
RSS20
rss20 provides reading and writing of RSS 2.0 format syndication feeds.
RSS0x
rss0x provides reading and writing of RSS 0.91 format syndication feeds.

Class Details

[line 38]
FeedParserBase provides an abstract ancestor class for feed parsers.



Tags:

author:  Michael Jervis (mike@fuckingbrit.com)
copyright:  Michael Jervis 2004
abstract:  


[ Top ]


Class Variables

$articles =

[line 56]

An array of items.

This holds all the news from the source. This should be an array of associative arrays. Each item will have: title - The title URI - Link to the full story date - The date of the article Optional (pre-defined) items are: summary - Short version of article text - full version author - Who wrote the article




Tags:

access:  public

Type:   mixed


[ Top ]

$copyright =

[line 96]

copyright tag:



Tags:

access:  public

Type:   mixed


[ Top ]

$description =

[line 76]

The description of the feed



Tags:

access:  public

Type:   mixed


[ Top ]

$encoding =

[line 61]

Encoding tag for the XML declaration



Tags:

access:  public

Type:   mixed


[ Top ]

$extensions =

[line 116]

Additional tags to add.



Tags:

access:  public

Type:   mixed


[ Top ]

$feedlogo =

[line 106]

Image to link to the feed.



Tags:

access:  public

Type:   mixed


[ Top ]

$lang =

[line 66]

Language for the feed



Tags:

access:  public

Type:   mixed


[ Top ]

$namespaces =

[line 111]

Additional namespaces to add.



Tags:

access:  public

Type:   mixed


[ Top ]

$sitecontact =

[line 91]

Site contact



Tags:

access:  public

Type:   mixed


[ Top ]

$sitelink =

[line 86]

URL of the site



Tags:

access:  public

Type:   mixed


[ Top ]

$system =

[line 101]

system powering the feed



Tags:

access:  public

Type:   mixed


[ Top ]

$title =

[line 71]

Title for the feed



Tags:

access:  public

Type:   mixed


[ Top ]

$url =

[line 81]

The URL of the feed



Tags:

access:  public

Type:   mixed


[ Top ]

$_currentItem =

[line 131]



Tags:

access:  protected

Type:   array


[ Top ]

$_currentTag =

[line 121]

Stuff for parsing XML



Tags:

access:  protected

Type:   mixed


[ Top ]

$_inItem =

[line 126]



Tags:

access:  protected

Type:   boolean


[ Top ]



Class Methods


constructor __construct [line 133]

FeedParserBase __construct( )



Tags:

access:  public


Overridden in child classes as:

Atom10::__construct()
Atom03::__construct()
RDF::__construct()
RSS20::__construct()

[ Top ]

method charData [line 293]

void charData( $parser, $data)

Handles character data.

Called by the parserfactory during parsing.




Tags:

abstract:  
access:  public


Overridden in child classes as:

Atom10::charData()
Handles character data.
Atom03::charData()
Handles character data.
RDF::charData()
Handles character data.
RSS20::charData()
Handles character data.
RSS0x::charData()
Handles character data.

Parameters:

   $parser  
   $data  

[ Top ]

method createFeed [line 186]

bool createFeed( string $fileName, [int $limit = ''])

Create a file for the stream

Writes the $items content to the file supplied in the format we have specified. Uses the (abstract) function formatArticle to return XML for an article.




Tags:

access:  public


Parameters:

string   $fileName   The fully qualified path to the file to create.
int   $limit   (optional) max number of items to write.

[ Top ]

method endElement [line 286]

void endElement( $parser, $name)

Handle the close of an XML element

Called by the parserfactory during parsing.




Tags:

abstract:  
access:  public


Overridden in child classes as:

Atom10::endElement()
Handle the close of an XML element
RDF::endElement()
Handle the close of an XML element
RSS20::endElement()
Handle the close of an XML element
RSS0x::endElement()
Handle the close of an XML element

Parameters:

   $parser  
   $name  

[ Top ]

method startElement [line 279]

void startElement( $parser, $name, $attributes)

Handle the begining of an XML element

This is called from the parserfactory once the type of data has been determined. Standard XML_PARSER element handler.




Tags:

author:  Michael Jervis (mike@fuckingbrit.com)
copyright:  Michael Jervis 2004
abstract:  
access:  public


Overridden in child classes as:

Atom10::startElement()
Handle the begining of an XML element
RDF::startElement()
Handle the begining of an XML element
RSS20::startElement()
Handle the begining of an XML element
RSS0x::startElement()
Handle the begining of an XML element

Parameters:

   $parser  
   $name  
   $attributes  

[ Top ]

method _feedFooter [line 268]

void _feedFooter( )

Return the formatted end of a feed.

just closes things off nicely.




Tags:

abstract:  
access:  protected


Overridden in child classes as:

Atom10::_feedFooter()
Return the formatted end of a feed.
RDF::_feedFooter()
Return the formatted end of a feed.
RSS20::_feedFooter()
Return the formatted end of a feed.
RSS0x::_feedFooter()
Return the formatted end of a feed.

[ Top ]

method _feedHeader [line 217]

void _feedHeader( )

Return the formatted start of a feed.

This will start the xml and create header information about the feed itself.




Tags:

access:  protected


Overridden in child classes as:

Atom10::_feedHeader()
Return the formatted start of a feed.
Atom03::_feedHeader()
Return the formatted start of a feed.
RDF::_feedHeader()
Return the formatted start of a feed.
RSS20::_feedHeader()
Return the formatted start of a feed.
RSS0x::_feedHeader()
Return the formatted start of a feed.

[ Top ]

method _formatArticle [line 261]

void _formatArticle( $article)

Format an article into feed specific XML.

Takes an associative article array and turns it into an XML definition of an article.




Tags:

abstract:  
access:  protected


Overridden in child classes as:

Atom10::_formatArticle()
Format an article into an Atom 0.3 <entry> tag.
Atom03::_formatArticle()
Format an article into an Atom 0.3 <entry> tag.
RDF::_formatArticle()
Format an article into an Atom 0.3 <entry> tag.
RSS20::_formatArticle()
Format an article into an RSS 2.0 <item> tag.
RSS0x::_formatArticle()
Format an article into an RSS 0.91 <item> tag.

Parameters:

array   $article   ASsociative array describing an article.

[ Top ]

method _injectExtendingTags [line 227]

void _injectExtendingTags( )

Inject extending tags into the feed header, if needed.



Tags:

access:  protected


[ Top ]

method _injectNamespaces [line 242]

void _injectNamespaces( )

Inject XMLNS items into the feed master element, if needed.



Tags:

access:  protected


[ Top ]

method _safeXML [line 153]

string _safeXML( string $string, [boolean $doubleEncode = true])

Make sure a string is safe to be chardata in an xml element



Tags:

access:  protected


Parameters:

string   $string   the string to escape.
boolean   $doubleEncode   whether to encode HTML entities

[ Top ]

method _writeFile [line 164]

void _writeFile( $fileName, $data)



Tags:

access:  protected


Parameters:

   $fileName  
   $data  

[ Top ]


Class Constants

LB =  "\n"

[line 40]


[ Top ]

LB2 =  "\n\n"

[line 41]


[ Top ]



Documentation generated on Sun, 02 Oct 2016 07:48:48 +0000 by phpDocumentor 1.4.3