Feed utility class

Base Zend_Feed class, containing constants and the Zend_Http_Client instance accessor.

category Zend
package Zend_Feed
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

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

findFeeds(string $uri) : array
Static

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

todo Allow findFeeds() to follow one, but only one, code 302.

Parameters

$uri

string

Exceptions

\Zend_Feed_Exception

Returns

array

Gets the HTTP client object. If none is set, a new Zend_Http_Client will be used.

getHttpClient() : \Zend_Http_Client_Abstract
Static

Returns

\Zend_Http_Client_Abstract

Get the HTTP override state

getHttpMethodOverride() : boolean
Static

Returns

boolean

Imports a feed located at $uri.

import(string $uri) : \Zend_Feed_Abstract
Static

Parameters

$uri

string

Exceptions

\Zend_Feed_Exception

Returns

\Zend_Feed_Abstract

Construct a new Zend_Feed_Abstract object from a custom array

importArray(array $data, string $format = 'atom') : \Zend_Feed_Abstract
Static

Parameters

$data

array

$format

string

(rss|atom) the requested output format

Returns

\Zend_Feed_Abstract

Construct a new Zend_Feed_Abstract object from a Zend_Feed_Builder_Interface data source

importBuilder(\Zend_Feed_Builder_Interface $builder, string $format = 'atom') : \Zend_Feed_Abstract
Static

Parameters

$builder

\Zend_Feed_Builder_Interface

this object will be used to extract the data of the feed

$format

string

(rss|atom) the requested output format

Returns

\Zend_Feed_Abstract

Imports a feed from a file located at $filename.

importFile(string $filename) : \Zend_Feed_Abstract
Static

Parameters

$filename

string

Exceptions

\Zend_Feed_Exception

Returns

\Zend_Feed_Abstract

Imports a feed represented by $string.

importString(string $string) : \Zend_Feed_Abstract
Static

Parameters

$string

string

Exceptions

\Zend_Feed_Exception

Returns

\Zend_Feed_Abstract

Get the full version of a namespace prefix

lookupNamespace($prefix) : string
Static

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.

Parameters

$prefix

Returns

string

Add a namespace and prefix to the registered list

registerNamespace(string $prefix, string $namespaceURI) : void
Static

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

Parameters

$prefix

string

The namespace prefix

$namespaceURI

string

The full namespace URI

Set the HTTP client instance

setHttpClient(\Zend_Http_Client $httpClient) : void
Static

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

Parameters

$httpClient

\Zend_Http_Client

Toggle using POST instead of PUT and DELETE HTTP methods

setHttpMethodOverride(boolean $override = true) : void
Static

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

$override

boolean

Whether to override PUT and DELETE.

 Properties

 

HTTP client object to use for retrieving feeds

$_httpClient : \Zend_Http_Client

Default

null
Static
 

Override HTTP PUT and DELETE request methods?

$_httpMethodOverride : boolean

Default

false
Static
 

$_namespaces

$_namespaces : array

Default

array('opensearch' => 'http://a9.com/-/spec/opensearchrss/1.0/', 'atom' => 'http://www.w3.org/2005/Atom', 'rss' => 'http://blogs.law.harvard.edu/tech/rss')
Static