print feedManager

feedManager is the primary interface used for reading and parsing website RSS and content feeds. It can handle auto-detection of the feed type and will return a feedChannel object that represents the feed.

feedManager can be used optionally with the cacheController for feed caching.

feedManager supports RSS1/2 and Atom feeds. Additional types can be added by updating the ReaderMap array and implementing a new reader.

Example usage:

Fetch a feed and iterate

$oFeed = feedManager::getInstance()->fetch('http://www.theregister.co.uk/headlines.atom');
foreach ( $oFeed->getItemSet() as $oFeedItem ) {
    // do something...
    echo $oFeedItem->getTitle(), '';
}

Fetch a feed, cache the results and iterate

$oCacheWriter = new cacheWriterFile(system::getConfig()->getPathTemp().'/feeds');
$oCacheWriter->setUseSubFolders(false);
feedManager::setCache(new cacheController($oCacheWriter));
$oFeed = feedManager::getInstance()->fetch('http://www.theregister.co.uk/headlines.atom');
foreach ( $oFeed->getItemSet() as $oFeedItem ) {
    // do something...
    echo $oFeedItem->getTitle(), '';
}

Methods

public static getInstance()

Returns a new instance of the feedManager

public static setCache($inCache)

Set the cacheController

public static getCache()

Returns the cacheController instance

public static hasCache()

Returns true if a cacheController instance has been set

public fetch($inUri, [$inType = 'auto'])

Fetches the feed specified in $inURI and returns a feedChannel object

public detectType()

Detects the type of feed

public parseFeed()

Creates the appropriate parser for the feed, and parses the feed

public getDomDocument()

Returns $_DomDocument

public setDomDocument($inDomDocument)

Set $_DomDocument to $inDomDocument

public getFeedUri()

Returns $_FeedUri

public setFeedUri($inFeedUri)

Set $_FeedUri to $inFeedUri

public getFeedType()

Returns $_FeedType

public setFeedType($inFeedType)

Set $_FeedType to $inFeedType

<  1  >