Ver Fonte

Updated sections of docs to sync to current API and behaviour

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@16967 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic há 16 anos atrás
pai
commit
b771f49dca
1 ficheiros alterados com 73 adições e 17 exclusões
  1. 73 17
      documentation/manual/en/module_specs/Zend_Feed_Reader.xml

+ 73 - 17
documentation/manual/en/module_specs/Zend_Feed_Reader.xml

@@ -711,9 +711,21 @@ if(isset($links->atom)) {
                         <entry><methodname>getExtensions()</methodname></entry>
 
                         <entry>
-                            Returns an array of non-Core Extension objects loaded for
+                            Returns an array of all Extension objects loaded for
                             the current feed (note: both feed-level and entry-level Extensions
                             exist, and only feed-level Extensions are returned here).
+                            The array keys are of the form {ExtensionName}_Feed.
+                        </entry>
+                    </row>
+
+                    <row>
+                        <entry><methodname>getExtension(string $name)</methodname></entry>
+
+                        <entry>
+                            Returns an Extension object for the feed registered under the
+                            provided name. This allows more fine-grained access to
+                            Extensions which may otherwise be hidden within the implementation
+                            of the standard API methods.
                         </entry>
                     </row>
 
@@ -972,10 +984,21 @@ if(isset($links->atom)) {
                         <entry><methodname>getExtensions()</methodname></entry>
 
                         <entry>
-                            Returns an array of non-Core Extension objects loaded for
+                            Returns an array of all Extension objects loaded for
                             the current entry (note: both feed-level and entry-level
                             Extensions exist, and only entry-level Extensions are returned
-                            here).
+                            here). The array keys are in the form {ExtensionName}_Entry.
+                        </entry>
+                    </row>
+
+                    <row>
+                        <entry><methodname>getExtension(string $name)</methodname></entry>
+
+                        <entry>
+                            Returns an Extension object for the entry registered under the
+                            provided name. This allows more fine-grained access to
+                            Extensions which may otherwise be hidden within the implementation
+                            of the standard API methods.
                         </entry>
                     </row>
 
@@ -1043,7 +1066,8 @@ if(isset($links->atom)) {
                     <row>
                         <entry>DublinCore (Feed and Entry)</entry>
 
-                        <entry>Implements support for both Dublin Core 1.0 and 1.1</entry>
+                        <entry>Implements support for Dublin Core Metadata Element Set 1.0
+                        and 1.1 </entry>
                     </row>
 
                     <row>
@@ -1061,13 +1085,26 @@ if(isset($links->atom)) {
                     <row>
                         <entry>Slash</entry>
 
-                        <entry>todo</entry>
+                        <entry>Implements support for the Slash RSS 1.0 module</entry>
                     </row>
 
                     <row>
                         <entry>WellFormedWeb</entry>
 
-                        <entry>todo</entry>
+                        <entry>Implements support for the Well Formed Web CommentAPI 1.0</entry>
+                    </row>
+
+                    <row>
+                        <entry>Thread</entry>
+
+                        <entry>Implements support for Atom Threading Extensions as described
+                        in RFC 4685</entry>
+                    </row>
+
+                    <row>
+                        <entry>Podcast</entry>
+
+                        <entry>Implements support for the Podcast 1.0 DTD from Apple</entry>
                     </row>
                 </tbody>
             </tgroup>
@@ -1077,7 +1114,7 @@ if(isset($links->atom)) {
             The Core Extensions are somewhat special since they are extremely
             common and multi-faceted. For example, we have a Core Extension for Atom.
             Atom is implemented as an Extension (not just a base class) because it
-            doubles as a valid <acronym>RSS</acronym> Extension - you can insert
+            doubles as a valid <acronym>RSS</acronym> module - you can insert
             Atom elements into <acronym>RSS</acronym> feeds. I've even seen
             <acronym>RDF</acronym> feeds which use a lot of Atom in place of more
             common Extensions like Dublin Core.
@@ -1086,10 +1123,17 @@ if(isset($links->atom)) {
         <table>
             <title>Non-Core Extensions (must register manually)</title>
 
-            <tgroup cols="1">
+            <tgroup cols="2">
                 <tbody>
                     <row>
-                        <entry>At present, no non-Core Extensions are distributed.</entry>
+                        <entry>Syndication</entry>
+                        <entry>Implements Syndication 1.0 support for RSS feeds</entry>
+                    </row>
+                    <row>
+                        <entry>CreativeCommons</entry>
+                        <entry>A RSS module that adds an element at the &lt;channel&gt;
+                        or &lt;item&gt; level that specifies which Creative Commons license
+                        applies.</entry>
                     </row>
                 </tbody>
             </tgroup>
@@ -1100,7 +1144,8 @@ if(isset($links->atom)) {
             <classname>Zend_Feed_Reader</classname> by default. If you want to
             use them, you'll need to tell
             <classname>Zend_Feed_Reader</classname> to load them in advance of
-            importing a feed.
+            importing a feed. Additional non-Core Extensions will be included
+            in future iterations of the component.
         </para>
 
         <para>
@@ -1115,21 +1160,32 @@ if(isset($links->atom)) {
         </para>
 
         <programlisting language="php"><![CDATA[
-Zend_Feed_Reader::registerExtension('Slash');
+Zend_Feed_Reader::registerExtension('Syndication');
 $feed = Zend_Feed_Reader::import('http://rss.slashdot.org/Slashdot/slashdot');
-$commentsForLastEntry = $feed->current()->getCommentCount();
+$updatePeriod = $feed->current()->getUpdatePeriod();
 ]]></programlisting>
 
         <para>
-            In the simple example above, we checked how many comments were made
-            on an entry using the <methodname>getCommentCount()</methodname>
+            In the simple example above, we checked how frequently a feed is being updated
+            using the <methodname>getUpdatePeriod()</methodname>
             method. Since it's not part of
             <classname>Zend_Feed_Reader</classname>'s core <acronym>API</acronym>, it could only be
-            a method supported by the newly registered Slash Extension (indeed
-            Slash was invented at Slashdot as an <acronym>RDF</acronym> Site Summary module and is
-            now fairly popular).
+            a method supported by the newly registered Syndication Extension.
         </para>
 
+        <para>
+            As you can also notice, the new methods from Extensions are accessible from the main
+            <acronym>API</acronym> using PHP's magic methods. As an alternative, you can also
+            directly access any Extension object for a similar result as seen below.
+        </para>
+
+        <programlisting language="php"><![CDATA[
+Zend_Feed_Reader::registerExtension('Syndication');
+$feed = Zend_Feed_Reader::import('http://rss.slashdot.org/Slashdot/slashdot');
+$syndication = $feed->getExtension('Syndication');
+$updatePeriod = $syndication->getUpdatePeriod();
+]]></programlisting>
+
         <sect3 id="zend.feed.reader.extending.feed">
             <title>Writing Zend_Feed_Reader Extensions</title>