|
|
@@ -154,77 +154,72 @@ $feed = Zend_Feed_Reader::importFeed($zfeed);
|
|
|
<title>Empfangen darunterliegender Quellen von Feeds und Einträgen</title>
|
|
|
|
|
|
<para>
|
|
|
- <classname>Zend_Feed_Reader</classname> does it's best not to stick
|
|
|
- you in a narrow confine. If you need to work on a feed outside of
|
|
|
- <classname>Zend_Feed_Reader</classname>, you can extract the base
|
|
|
- <classname>DOMDocument</classname> or
|
|
|
- <classname>DOMElement</classname> objects from any class, or even an
|
|
|
- <acronym>XML</acronym> string containing these. Also provided are methods to extract
|
|
|
- the current <classname>DOMXPath</classname> object (with all core
|
|
|
- and Extension namespaces registered) and the correct prefix used in
|
|
|
- all XPath queries for the current Feed or Entry. The basic methods
|
|
|
- to use (on any object) are <methodname>saveXml()</methodname>,
|
|
|
- <methodname>getDomDocument()</methodname>,
|
|
|
- <methodname>getElement()</methodname>,
|
|
|
- <methodname>getXpath()</methodname> and
|
|
|
- <methodname>getXpathPrefix()</methodname>. These will let you break
|
|
|
- free of <classname>Zend_Feed_Reader</classname> and do whatever else
|
|
|
- you want.
|
|
|
+ <classname>Zend_Feed_Reader</classname> macht sein bestes um Ihnen die Details
|
|
|
+ abzunehmen. Wenn man an einem Feed ausserhalb von
|
|
|
+ <classname>Zend_Feed_Reader</classname> arbeiten muß, kann man das grundsätzliche
|
|
|
+ <classname>DOMDocument</classname> oder <classname>DOMElement</classname> von jeder
|
|
|
+ Klasse extrahieren, oder sogar einen <acronym>XML</acronym> String der sie enthält.
|
|
|
+ Es werden auch Methoden angeboten um das aktuelle <classname>DOMXPath</classname>
|
|
|
+ Objekt (mit allen registrierten Kern und Erweiterungs Namespaces) zu extrahieren, und
|
|
|
+ den richtigen Präfix der in allen XPath Anfragen für den aktuellen Feed oder Eintrag
|
|
|
+ verwendet wird. Die grundsätzlich zu verwenden Methoden (für jedes Objekt) sind
|
|
|
+ <methodname>saveXml()</methodname>, <methodname>getDomDocument()</methodname>,
|
|
|
+ <methodname>getElement()</methodname>, <methodname>getXpath()</methodname> und
|
|
|
+ <methodname>getXpathPrefix()</methodname>. Diese erlauben es sich von
|
|
|
+ <classname>Zend_Feed_Reader</classname> zu lösen und das zu tun was man selbst
|
|
|
+ machen will.
|
|
|
</para>
|
|
|
|
|
|
<itemizedlist>
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <methodname>saveXml()</methodname> returns an <acronym>XML</acronym> string
|
|
|
- containing only the element representing the current object.
|
|
|
+ <methodname>saveXml()</methodname> gibt einen <acronym>XML</acronym> String
|
|
|
+ zurück der nur das Element enthält welches das aktuelle Objekt repräsentiert.
|
|
|
</para>
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <methodname>getDomDocument()</methodname> returns the
|
|
|
- <classname>DOMDocument</classname> object representing the
|
|
|
- entire feed (even if called from an Entry object).
|
|
|
+ <methodname>getDomDocument()</methodname> gibt das
|
|
|
+ <classname>DOMDocument</classname> Objekt zurück das den kompletten Feed
|
|
|
+ repräsentiert (sogar wenn es von einem Entry Objekt aus aufgerufen wird).
|
|
|
</para>
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <methodname>getElement()</methodname> returns the
|
|
|
- <classname>DOMElement</classname> of the current object
|
|
|
- (i.e. the Feed or current Entry).
|
|
|
+ <methodname>getElement()</methodname> gibt das <classname>DOMElement</classname>
|
|
|
+ des aktuellen Objekts zurück (z.B. den Feed oder aktuellen Eintrag).
|
|
|
</para>
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <methodname>getXpath()</methodname> returns the
|
|
|
- <classname>DOMXPath</classname> object for the current feed
|
|
|
- (even if called from an Entry object) with the namespaces of
|
|
|
- the current feed type and all loaded Extensions
|
|
|
- pre-registered.
|
|
|
+ <methodname>getXpath()</methodname> gibt das aktuelle
|
|
|
+ <classname>DOMXPath</classname> Objekt für den aktuellen Feed zurück (sogar wenn
|
|
|
+ es von einem Entry Objekt aus aufgerufen wird) mit den Namespaces des aktuellen
|
|
|
+ Feed Typs und allen vor-registrierten geladenen Erweiterungen.
|
|
|
</para>
|
|
|
</listitem>
|
|
|
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <methodname>getXpathPrefix()</methodname> returns the query
|
|
|
- prefix for the current object (i.e. the Feed or current
|
|
|
- Entry) which includes the correct XPath query path for that
|
|
|
- specific Feed or Entry.
|
|
|
+ <methodname>getXpathPrefix()</methodname> gibt den Präfix der Abfrage für das
|
|
|
+ aktuelle Objekt zurück (z.B. den Feed oder den aktuellen Eintrag) welcher den
|
|
|
+ richtigen XPath Query Pfad für den spezifizierten Feed oder Eintrag enthält.
|
|
|
</para>
|
|
|
</listitem>
|
|
|
</itemizedlist>
|
|
|
|
|
|
<para>
|
|
|
- Here's an example where a feed might include an <acronym>RSS</acronym> Extension not
|
|
|
- supported by <classname>Zend_Feed_Reader</classname> out of the box.
|
|
|
- Notably, you could write and register an Extension (covered later)
|
|
|
- to do this, but that's not always warranted for a quick check. You
|
|
|
- must register any new namespaces on the
|
|
|
- <classname>DOMXPath</classname> object before use unless they are
|
|
|
- registered by <classname>Zend_Feed_Reader</classname> or an
|
|
|
- Extension beforehand.
|
|
|
+ Hier ist ein Beispiel bei dem ein Feed eine <acronym>RSS</acronym> Erweiterung enthalten
|
|
|
+ können die von <classname>Zend_Feed_Reader</classname> nicht out of the Box unterstützt
|
|
|
+ wird. Beachtenswert ist, das man eine Erweiterungen schreiben und registrieren könnte
|
|
|
+ (wird später behandelt) um das zu bewerkstelligen, aber das ist nicht immer eine
|
|
|
+ Garantie für einen schnellen Check. Man muß jeden neuen Namespace beim
|
|
|
+ <classname>DOMXPath</classname> Objekt registrieren bevor es verwendet wird ausser Sie
|
|
|
+ werden vorab von <classname>Zend_Feed_Reader</classname> oder einer Erweiterung
|
|
|
+ registriert.
|
|
|
</para>
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|
|
|
@@ -239,29 +234,28 @@ $reportErrorsTo = $xpath->evaluate('string('
|
|
|
|
|
|
<warning>
|
|
|
<para>
|
|
|
- If you register an already registered namespace with a different
|
|
|
- prefix name to that used internally by
|
|
|
- <classname>Zend_Feed_Reader</classname>, it will break the
|
|
|
- internal operation of this component.
|
|
|
+ Wenn man einen bereits registrierten Namespace mit einem anderen Präfix Namen
|
|
|
+ registriert als jenen der von <classname>Zend_Feed_Reader</classname> intern
|
|
|
+ verwendet wird, zerstört das die Interne Arbeitsweise dieser Komponente.
|
|
|
</para>
|
|
|
</warning>
|
|
|
</sect2>
|
|
|
|
|
|
<sect2 id="zend.feed.reader.cache-request">
|
|
|
- <title>Cache Support and Intelligent Requests</title>
|
|
|
+ <title>Unterstützung für Caches und intelligente Anfragen</title>
|
|
|
|
|
|
<sect3 id="zend.feed.reader.cache-request.cache">
|
|
|
- <title>Adding Cache Support to Zend_Feed_Reader</title>
|
|
|
+ <title>Unterstützung für Caches in Zend_Feed_Reader hinzufügen</title>
|
|
|
|
|
|
<para>
|
|
|
- <classname>Zend_Feed_Reader</classname> supports using an
|
|
|
- instance of <classname>Zend_Cache</classname> to cache feeds (as
|
|
|
- <acronym>XML</acronym>) to avoid unnecessary network requests. Adding a cache is as
|
|
|
- simple here as it is for other Zend Framework components, create
|
|
|
- and configure your cache and then tell
|
|
|
- <classname>Zend_Feed_Reader</classname> to use it! The cache key
|
|
|
- used is "<classname>Zend_Feed_Reader_</classname>" followed by the
|
|
|
- <acronym>MD5</acronym> hash of the feed's <acronym>URI</acronym>.
|
|
|
+ <classname>Zend_Feed_Reader</classname> unterstützt die Verwendung einer Instanz von
|
|
|
+ <classname>Zend_Cache</classname> um Feeds zu cachen (als <acronym>XML</acronym>)
|
|
|
+ um unnötige Anfragen im Netzwerk zu vermeiden. Das Hinzufügen eines Caches ist hier
|
|
|
+ so einfach wie bei anderen Zend Framework Komponenten. Den Cache erstellen und
|
|
|
+ konfigurieren und dann <classname>Zend_Feed_Reader</classname> mitteilen das er
|
|
|
+ verwendet werden soll! Der verwendete Cache Schlüssel ist
|
|
|
+ "<classname>Zend_Feed_Reader_</classname>" gefolgt von dem
|
|
|
+ <acronym>MD5</acronym> Hash der <acronym>URI</acronym> des Feeds.
|
|
|
</para>
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|