Zend Framework  1.12
Static Public Member Functions | Public Attributes | Static Protected Member Functions | Static Protected Attributes | List of all members
Zend_Feed_Reader Class Reference

Static Public Member Functions

static getCache ()
 Get the Feed cache.
 
static setCache (Zend_Cache_Core $cache)
 Set the feed cache.
 
static setHttpClient (Zend_Http_Client $httpClient)
 Set the HTTP client instance.
 
static getHttpClient ()
 Gets the HTTP client object.
 
static setHttpMethodOverride ($override=true)
 Toggle using POST instead of PUT and DELETE HTTP methods.
 
static getHttpMethodOverride ()
 Get the HTTP override state.
 
static useHttpConditionalGet ($bool=true)
 Set the flag indicating whether or not to use HTTP conditional GET.
 
static import ($uri, $etag=null, $lastModified=null)
 Import a feed by providing a URL.
 
static importFeed (Zend_Feed_Abstract $feed)
 Import a feed by providing a Zend_Feed_Abstract object.
 
static importString ($string)
 Import a feed from a string.
 
static importFile ($filename)
 Imports a feed from a file located at $filename.
 
static findFeedLinks ($uri)
 
static detectType ($feed, $specOnly=false)
 Detect the feed type of the provided feed.
 
static setPluginLoader (Zend_Loader_PluginLoader_Interface $loader)
 Set plugin loader for use with Extensions.
 
static getPluginLoader ()
 Get plugin loader for use with Extensions.
 
static addPrefixPath ($prefix, $path)
 Add prefix path for loading Extensions.
 
static addPrefixPaths (array $spec)
 Add multiple Extension prefix paths at once.
 
static registerExtension ($name)
 Register an Extension by name.
 
static isRegistered ($extensionName)
 Is a given named Extension registered?
 
static getExtensions ()
 Get a list of extensions.
 
static reset ()
 Reset class state to defaults.
 
static arrayUnique (array $array)
 Utility method to apply array_unique operation to a multidimensional array.
 

Public Attributes

const NAMESPACE_ATOM_03 = 'http://purl.org/atom/ns#'
 Namespace constants.
 
const NAMESPACE_ATOM_10 = 'http://www.w3.org/2005/Atom'
 
const NAMESPACE_RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
 
const NAMESPACE_RSS_090 = 'http://my.netscape.com/rdf/simple/0.9/'
 
const NAMESPACE_RSS_10 = 'http://purl.org/rss/1.0/'
 
const TYPE_ANY = 'any'
 Feed type constants.
 
const TYPE_ATOM_03 = 'atom-03'
 
const TYPE_ATOM_10 = 'atom-10'
 
const TYPE_ATOM_10_ENTRY = 'atom-10-entry'
 
const TYPE_ATOM_ANY = 'atom'
 
const TYPE_RSS_090 = 'rss-090'
 
const TYPE_RSS_091 = 'rss-091'
 
const TYPE_RSS_091_NETSCAPE = 'rss-091n'
 
const TYPE_RSS_091_USERLAND = 'rss-091u'
 
const TYPE_RSS_092 = 'rss-092'
 
const TYPE_RSS_093 = 'rss-093'
 
const TYPE_RSS_094 = 'rss-094'
 
const TYPE_RSS_10 = 'rss-10'
 
const TYPE_RSS_20 = 'rss-20'
 
const TYPE_RSS_ANY = 'rss'
 

Static Protected Member Functions

static _registerCoreExtensions ()
 Register core (default) extensions.
 

Static Protected Attributes

static $_cache = null
 
static $_httpClient = null
 
static $_httpMethodOverride = false
 
static $_httpConditionalGet = false
 
static $_pluginLoader = null
 
static $_prefixPaths = array()
 
static $_extensions
 

Member Function Documentation

static _registerCoreExtensions ( )
staticprotected

Register core (default) extensions.

Returns
void
static addPrefixPath (   $prefix,
  $path 
)
static

Add prefix path for loading Extensions.

Parameters
string$prefix
string$path
Returns
void
static addPrefixPaths ( array  $spec)
static

Add multiple Extension prefix paths at once.

Parameters
array$spec
Returns
void
static arrayUnique ( array  $array)
static

Utility method to apply array_unique operation to a multidimensional array.

Parameters
array
Returns
array
static detectType (   $feed,
  $specOnly = false 
)
static

Detect the feed type of the provided feed.

Parameters
Zend_Feed_Abstract | DOMDocument | string$feed
bool$specOnly
Returns
string
Exceptions
Zend_Feed_Exception
static findFeedLinks (   $uri)
static
static getCache ( )
static

Get the Feed cache.

Returns
Zend_Cache_Core
static getExtensions ( )
static

Get a list of extensions.

Returns
array
static getHttpClient ( )
static

Gets the HTTP client object.

If none is set, a new Zend_Http_Client will be used.

Returns
Zend_Http_Client_Abstract
See Also
Zend_Http_Client
static getHttpMethodOverride ( )
static

Get the HTTP override state.

Returns
boolean
static getPluginLoader ( )
static

Get plugin loader for use with Extensions.

Returns
Zend_Loader_PluginLoader_Interface $loader
static import (   $uri,
  $etag = null,
  $lastModified = null 
)
static

Import a feed by providing a URL.

Parameters
string$urlThe URL to the feed
string$etagOPTIONAL Last received ETag for this resource
string$lastModifiedOPTIONAL Last-Modified value for this resource
Returns
Zend_Feed_Reader_FeedInterface
static importFeed ( Zend_Feed_Abstract  $feed)
static

Import a feed by providing a Zend_Feed_Abstract object.

Parameters
Zend_Feed_Abstract$feedA fully instantiated Zend_Feed object
Returns
Zend_Feed_Reader_FeedInterface
static importFile (   $filename)
static

Imports a feed from a file located at $filename.

Parameters
string$filename
Exceptions
Zend_Feed_Exception
Returns
Zend_Feed_Reader_FeedInterface
See Also
Zend_Feed_Exception
static importString (   $string)
static

Import a feed from a string.

Parameters
string$string
Returns
Zend_Feed_Reader_FeedInterface
static isRegistered (   $extensionName)
static

Is a given named Extension registered?

Parameters
string$extensionName
Returns
boolean
static registerExtension (   $name)
static

Register an Extension by name.

Parameters
string$name
Returns
void
Exceptions
Zend_Feed_Exceptionif unable to resolve Extension class
static reset ( )
static

Reset class state to defaults.

Returns
void
static setCache ( Zend_Cache_Core  $cache)
static

Set the feed cache.

Parameters
Zend_Cache_Core$cache
Returns
void
static setHttpClient ( Zend_Http_Client  $httpClient)
static

Set the HTTP client instance.

Sets the HTTP client object to use for retrieving the feeds.

Parameters
Zend_Http_Client$httpClient
Returns
void
static setHttpMethodOverride (   $override = true)
static

Toggle using POST instead of PUT and DELETE HTTP methods.

Some feed implementations do not accept PUT and DELETE HTTP methods, or they can't be used because of proxies or other measures. This allows turning on using POST where PUT and DELETE would normally be used; in addition, an X-Method-Override header will be sent with a value of PUT or DELETE as appropriate.

Parameters
boolean$overrideWhether to override PUT and DELETE.
Returns
void
static setPluginLoader ( Zend_Loader_PluginLoader_Interface  $loader)
static

Set plugin loader for use with Extensions.

Parameters
Zend_Loader_PluginLoader_Interface$loader
static useHttpConditionalGet (   $bool = true)
static

Set the flag indicating whether or not to use HTTP conditional GET.

Parameters
bool$bool
Returns
void

Member Data Documentation

$_cache = null
staticprotected
$_extensions
staticprotected
Initial value:
= array(
'feed' => array(
'DublinCore_Feed',
'Atom_Feed'
),
'entry' => array(
'Content_Entry',
'DublinCore_Entry',
'Atom_Entry'
),
'core' => array(
'DublinCore_Feed',
'Atom_Feed',
'Content_Entry',
'DublinCore_Entry',
'Atom_Entry'
)
)
$_httpClient = null
staticprotected
$_httpConditionalGet = false
staticprotected
$_httpMethodOverride = false
staticprotected
$_pluginLoader = null
staticprotected
$_prefixPaths = array()
staticprotected
const NAMESPACE_ATOM_03 = 'http://purl.org/atom/ns#'

Namespace constants.

const NAMESPACE_ATOM_10 = 'http://www.w3.org/2005/Atom'
const NAMESPACE_RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
const NAMESPACE_RSS_090 = 'http://my.netscape.com/rdf/simple/0.9/'
const NAMESPACE_RSS_10 = 'http://purl.org/rss/1.0/'
const TYPE_ANY = 'any'

Feed type constants.

const TYPE_ATOM_03 = 'atom-03'
const TYPE_ATOM_10 = 'atom-10'
const TYPE_ATOM_10_ENTRY = 'atom-10-entry'
const TYPE_ATOM_ANY = 'atom'
const TYPE_RSS_090 = 'rss-090'
const TYPE_RSS_091 = 'rss-091'
const TYPE_RSS_091_NETSCAPE = 'rss-091n'
const TYPE_RSS_091_USERLAND = 'rss-091u'
const TYPE_RSS_092 = 'rss-092'
const TYPE_RSS_093 = 'rss-093'
const TYPE_RSS_094 = 'rss-094'
const TYPE_RSS_10 = 'rss-10'
const TYPE_RSS_20 = 'rss-20'
const TYPE_RSS_ANY = 'rss'