Class xml_domit_rss_base_document

Description

A base class for DOMIT! RSS and DOMIT! RSS Lite documents

Located in /includes/domit/xml_domit_rss_shared.php (line 437)

xml_domit_rss_base
   |
   --xml_domit_rss_elementindexer
      |
      --xml_domit_rss_base_document
Direct descendents
Class Description
xml_domit_rss_document The base DOMIT! RSS document class
xml_domit_rss_document_lite The base DOMIT! RSS Lite document class
Variable Summary
Method Summary
mixed xml_domit_rss_base_document ([string $url = ''], [string $cacheDir = './'], [int $cacheTime = 3600])
void createDefaultCache ([string $cacheDir = './'], [int $cacheTime = 3600])
void createDocument ()
void disableCache ()
void establishConnection (string $url)
boolean &fromFile (string $filename)
boolean &fromString (string $rssText)
Object &getChannel (mixed $index)
string getDataFromCache (string $url)
Object &getDocument ()
Object &getNode ()
string getRSSVersion ()
string getTextFromFile (string $filename)
boolean loadRSS (string $url)
boolean loadRSSData (string $url)
string parsedBy ()
boolean parseRSS (string $rssText)
boolean parseRSSData (string $rssText)
void setAuthorization (string $user, string $password)
void setConnection (string $host, [string $path = '/'], [int $port = 80], int $timeout, [string $user = null], [string $password = null])
void setProxyAuthorization (string $user, string $password)
void setProxyConnection (string $host, [string $path = '/'], [int $port = 80], int $timeout, [string $user = null], [string $password = null])
void useCacheLite (boolean $doUseCacheLite, [string $pathToLibrary = './Lite.php'], [string $cacheDir = './'], [int $cacheTime = 3600])
Variables
Object $cache (line 447)
  • var: A reference to the file caching object
boolean $cacheEnabled = true (line 445)
  • var: True if caching is enabled
array $domit_rss_categories = array() (line 443)
  • var: An array of existing category elements
array $domit_rss_channels = array() (line 441)
  • var: An array of existing channel elements
array $domit_rss_items = array() (line 439)
  • var: An array of item elements (only present in some RSS formats)
object A $httpConnection = null (line 453)
  • var: reference to a http connection or proxy, if one is required
string $parser (line 451)
  • var: The name of the current parser - either 'DOMIT_RSS' or 'DOMIT_RSS_LITE'
boolean $useCacheLite = false (line 449)
  • var: True if PEAR:Cache_Lite is to be used instead of php_text_cache

Inherited Variables

Inherited from xml_domit_rss_elementindexer

xml_domit_rss_elementindexer::$DOMIT_RSS_indexer
xml_domit_rss_elementindexer::$DOMIT_RSS_numericalIndexer

Inherited from xml_domit_rss_base

xml_domit_rss_base::$node
xml_domit_rss_base::$rssDefinedElements
Methods
Constructor xml_domit_rss_base_document (line 462)

Constructor

  • return: Null if an url was not provided, true if an url was provided and parsing was successful, false otherwise
mixed xml_domit_rss_base_document ([string $url = ''], [string $cacheDir = './'], [int $cacheTime = 3600])
  • string $url: Path to the rss file
  • string $cacheDir: Directory in which cache files are to be stored
  • int $cacheTime: Expiration time (in seconds) for the cache file
createDefaultCache (line 570)

Instantiates a default cache (php_text_cache)

void createDefaultCache ([string $cacheDir = './'], [int $cacheTime = 3600])
  • string $cacheDir: Directory for cache files
  • int $cacheTime: Expiration time for a cache file
createDocument (line 533)

Creates an empty DOMIT! document to contain the RSS nodes

void createDocument ()
disableCache (line 578)

Disables caching mechanism

void disableCache ()
establishConnection (line 692)

Establishes a connection, given an url

void establishConnection (string $url)
  • string $url: The url of the data
fromFile (line 673)

Reads in RSS text from a file and parses it

  • return: True if parsing is successful
boolean &fromFile (string $filename)
  • string $filename: The file path
fromString (line 683)

Reads in RSS text from a string and parses it

  • return: True if parsing is successful
boolean &fromString (string $rssText)
  • string $rssText: The RSS text
getChannel (line 805)

Returns a reference to the channel located at the specified index

  • return: A reference to the channel located at the specified index
Object &getChannel (mixed $index)
getChannelCount (line 797)

Returns the number of channels in the document

  • return: The number of channels in the document
int getChannelCount ()
getDataFromCache (line 633)

Retrieves the RSS data from the url/cache file

  • return: The RSS data
string getDataFromCache (string $url)
  • string $url: The url for the RSS data
getDocument (line 730)

Gets a reference to the underlying DOM document

  • return: A reference to the underlying DOM document
Object &getDocument ()
getNode (line 738)

Gets a reference to the root DOM element

  • return: A reference to the root DOM element
Object &getNode ()

Redefinition of:
xml_domit_rss_base::getNode()
Retrieves the underlying DOMIT node
getRSSVersion (line 766)

Returns the version of RSS used to format the data

  • return: The version of RSS used to format the data
string getRSSVersion ()
getTextFromFile (line 706)

Get text from an url or file

  • return: The text contained in the url or file, or an empty string
string getTextFromFile (string $filename)
  • string $filename: The url or file path
handleChannelElementsEmbedded (line 745)

Forces channel elements that are external to a channel to be referenced as subelements of that channel

void handleChannelElementsEmbedded ()
loadRSS (line 587)

Loads and parses the RSS at the specified url

  • return: True if parsing is successful
boolean loadRSS (string $url)
  • string $url: The url of the RSS feed
loadRSSData (line 623)

Retrieves the RSS data from the url/cache file and parses

  • return: True if parsing is successful
boolean loadRSSData (string $url)
  • string $url: The url for the RSS data
parsedBy (line 526)

Returns the name of the parser

  • return: Either 'DOMIT_RSS' or 'DOMIT_RSS_LITE'
string parsedBy ()
parseRSS (line 607)

Parses the RSS text provided

  • return: True if parsing is successful
boolean parseRSS (string $rssText)
  • string $rssText: The RSS text
parseRSSData (line 659)

Parses the RSS data provided

  • return: True if parsing is successful
boolean parseRSSData (string $rssText)
  • string $rssText: The the RSS data
setAuthorization (line 494)

Specifies basic authentication for an http connection

void setAuthorization (string $user, string $password)
  • string $user: The user name
  • string $password: The password
setConnection (line 483)

Specifies the parameters of the http conection used to obtain the xml data

void setConnection (string $host, [string $path = '/'], [int $port = 80], int $timeout, [string $user = null], [string $password = null])
  • string $host: The ip address or domain name of the connection
  • string $path: The path of the connection
  • int $port: The port that the connection is listening on
  • int $timeout: The timeout value for the connection
  • string $user: The user name, if authentication is required
  • string $password: The password, if authentication is required
setProxyAuthorization (line 518)

Specifies a user name and password for the proxy

void setProxyAuthorization (string $user, string $password)
  • string $user: The user name
  • string $password: The password
setProxyConnection (line 507)

Specifies that a proxy is to be used to obtain the xml data

void setProxyConnection (string $host, [string $path = '/'], [int $port = 80], int $timeout, [string $user = null], [string $password = null])
  • string $host: The ip address or domain name of the proxy
  • string $path: The path to the proxy
  • int $port: The port that the proxy is listening on
  • int $timeout: The timeout value for the connection
  • string $user: The user name, if authentication is required
  • string $password: The password, if authentication is required
useCacheLite (line 546)

Substitutes PEAR::Cache_Lite for the default php_text_cache

void useCacheLite (boolean $doUseCacheLite, [string $pathToLibrary = './Lite.php'], [string $cacheDir = './'], [int $cacheTime = 3600])
  • boolean $doUseCacheLite: True if Cache Lite is to be used
  • string $pathToLibrary: Absolute or relative path to the Cache Lite library
  • string $cacheDir: Directory for cache files
  • int $cacheTime: Expiration time for a cache file

Inherited Methods

Inherited From xml_domit_rss_elementindexer

xml_domit_rss_elementindexer::addIndexedElement()
xml_domit_rss_elementindexer::getElement()
xml_domit_rss_elementindexer::getElementAt()
xml_domit_rss_elementindexer::getElementList()
xml_domit_rss_elementindexer::getElementText()
xml_domit_rss_elementindexer::getElementTextAt()
xml_domit_rss_elementindexer::hasElement()
xml_domit_rss_elementindexer::indexNumerically()
xml_domit_rss_elementindexer::isCollection()
xml_domit_rss_elementindexer::isCustomRSSElement()
xml_domit_rss_elementindexer::isNode()
xml_domit_rss_elementindexer::_getElementText()
xml_domit_rss_elementindexer::_init()

Inherited From xml_domit_rss_base

xml_domit_rss_base::getAttribute()
xml_domit_rss_base::getNode()
xml_domit_rss_base::hasAttribute()
xml_domit_rss_base::isRSSDefined()
xml_domit_rss_base::isSimpleRSSElement()
xml_domit_rss_base::toNormalizedString()
xml_domit_rss_base::toString()

Documentation generated on Fri, 4 Mar 2005 13:57:58 +1000 by phpDocumentor 1.3.0RC3