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

Static Public Member Functions

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 lookupNamespace ($prefix)
 Get the full version of a namespace prefix.
 
static registerNamespace ($prefix, $namespaceURI)
 Add a namespace and prefix to the registered list.
 
static import ($uri)
 Imports a feed located at $uri.
 
static importString ($string)
 Imports a feed represented by $string.
 
static importFile ($filename)
 Imports a feed from a file located at $filename.
 
static findFeeds ($uri)
 Attempts to find feeds at $uri referenced by <link ...
 
static importArray (array $data, $format= 'atom')
 Construct a new Zend_Feed_Abstract object from a custom array.
 
static importBuilder (Zend_Feed_Builder_Interface $builder, $format= 'atom')
 Construct a new Zend_Feed_Abstract object from a Zend_Feed_Builder_Interface data source.
 

Static Protected Attributes

static $_httpClient = null
 
static $_httpMethodOverride = false
 
static $_namespaces
 

Member Function Documentation

static findFeeds (   $uri)
static

Attempts to find feeds at $uri referenced by <link ...

/> tags. Returns an array of the feeds referenced at $uri.

Todo:
Allow findFeeds() to follow one, but only one, code 302.
Parameters
string$uri
Exceptions
Zend_Feed_Exception
Returns
array
See Also
Zend_Feed_Exception
Zend_Feed_Exception
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 import (   $uri)
static

Imports a feed located at $uri.

Parameters
string$uri
Exceptions
Zend_Feed_Exception
Returns
Zend_Feed_Abstract
See Also
Zend_Feed_Exception
static importArray ( array  $data,
  $format = 'atom' 
)
static

Construct a new Zend_Feed_Abstract object from a custom array.

Parameters
array$data
string$format(rss|atom) the requested output format
Returns
Zend_Feed_Abstract
See Also
Zend_Feed_Builder
static importBuilder ( Zend_Feed_Builder_Interface  $builder,
  $format = 'atom' 
)
static

Construct a new Zend_Feed_Abstract object from a Zend_Feed_Builder_Interface data source.

Parameters
Zend_Feed_Builder_Interface$builderthis object will be used to extract the data of the feed
string$format(rss|atom) the requested output format
Returns
Zend_Feed_Abstract
static importFile (   $filename)
static

Imports a feed from a file located at $filename.

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

Imports a feed represented by $string.

Parameters
string$string
Exceptions
Zend_Feed_Exception
Returns
Zend_Feed_Abstract
See Also
Zend_Feed_Exception
Zend_Feed_Atom
Zend_Feed_Rss
Zend_Feed_Exception
static lookupNamespace (   $prefix)
static

Get the full version of a namespace prefix.

Looks up a prefix (atom:, etc.) in the list of registered namespaces and returns the full namespace URI if available. Returns the prefix, unmodified, if it's not registered.

Returns
string
static registerNamespace (   $prefix,
  $namespaceURI 
)
static

Add a namespace and prefix to the registered list.

Takes a prefix and a full namespace URI and adds them to the list of registered namespaces for use by Zend_Feed::lookupNamespace().

Parameters
string$prefixThe namespace prefix
string$namespaceURIThe full namespace URI
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

Member Data Documentation

$_httpClient = null
staticprotected
$_httpMethodOverride = false
staticprotected
$_namespaces
staticprotected
Initial value:
= array(
'opensearch' => 'http://a9.com/-/spec/opensearchrss/1.0/',
'atom' => 'http://www.w3.org/2005/Atom',
'rss' => 'http://blogs.law.harvard.edu/tech/rss',
)