Zend_Feed_Reader is a component used to
consume RSS and Atom feeds of any version, including
RSS 2.0, Atom 0.3 and Atom 1.0. The API for
retrieving feed data is
deliberately simple since
capable of searching any feed of any type for the information
requested through the API. If the typical elements containing this
information are not present, it will adapt and fall back on a
variety of alternative elements instead. This ability to choose from
alternatives removes the need for users to create their own
abstraction layer on top of the component to make it useful or have
any in-depth knowledge of the underlying standards, current
alternatives, and namespaced extensions.
Zend_Feed_Reader works almost
entirely on the basis of making XPath queries against the feed XML's
Document Object Model. The DOM is not exposed though a chained
property API like
Zend_Feed though the
underlying DOMDocument, DOMElement and DOMXPath objects are exposed for external
manipulation. This singular approach to parsing is consistent and
the component offers a plugin system to add to the Feed and Entry
level API by writing Extensions on a similar basis.
Performance is assisted in three ways. First of all,
Zend_Feed_Reader supports caching using
Zend_Cache to maintain a copy of the original
feed XML. This allows you to skip network requests for a feed
the cache is valid. Second, the Feed and Entry level API is backed
by an internal cache (non-persistant) so repeat API calls for the
same feed will avoid additional DOM or XPath use. Thirdly, importing
feeds from a URI can take advantage of
which allow servers to issue an empty 304 response when the
requested feed has not changed since the last time you requested it.
In the final case, an instance of
will hold the last received feed along with the ETag and
Last-Modified header values sent in the HTTP response.
In relation to
Zend_Feed_Reader was formulated as a free
standing replacement for
Zend_Feed but it is
not backwards compatible with
Rather it is an alternative following a different ideology focused
on being simple to use, flexible, consistent and extendable through
the plugin system.
Zend_Feed_Reader is also
not capable of constructing feeds and delegates this responsibility
Zend_Feed_Writer, its sibling in arms.