|
|
@@ -1,6 +1,6 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!-- Reviewed: no -->
|
|
|
-<!-- EN-Revision: 19457 -->
|
|
|
+<!-- EN-Revision: 19819 -->
|
|
|
<sect1 id="migration.110">
|
|
|
<title>Zend Framework 1.10</title>
|
|
|
|
|
|
@@ -9,6 +9,67 @@
|
|
|
下記の移行上の注意点に注意すべきです。
|
|
|
</para>
|
|
|
|
|
|
+ <!-- TODO : to be translated -->
|
|
|
+ <sect2 id="migration.110.zend.feed.reader">
|
|
|
+ <title>Zend_Feed_Reader</title>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ With the introduction of Zend Framework 1.10, <classname>Zend_Feed_Reader</classname>'s
|
|
|
+ handling of retrieving Authors and Contributors was changed, introducing
|
|
|
+ a break in backwards compatibility. This change was an effort to harmonise
|
|
|
+ the treatment of such data across the RSS and Atom classes of the component
|
|
|
+ and enable the return of Author and Contributor data in more accessible,
|
|
|
+ usable and detailed form. It also rectifies an error in that it was assumed
|
|
|
+ any author element referred to a name. In RSS this is incorrect as an
|
|
|
+ author element is actually only required to provide an email address.
|
|
|
+ In addition, the original implementation applied its RSS limits to Atom
|
|
|
+ feeds significantly reducing the usefulness of the parser with that format.
|
|
|
+ </para>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ The change means that methods like <methodname>getAuthors()</methodname>
|
|
|
+ and <methodname>getContributors</methodname> no longer return a simple array
|
|
|
+ of strings parsed from the relevant RSS and Atom elements. Instead, the return
|
|
|
+ value is an <classname>ArrayObject</classname> subclass called
|
|
|
+ <classname>Zend_Feed_Reader_Collection_Author</classname> which simulates
|
|
|
+ an iterable multidimensional array of Authors. Each member of this object
|
|
|
+ will be a simple array with three potential keys (as the source data permits).
|
|
|
+ These include: name, email and uri.
|
|
|
+ </para>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ The original behaviour of such methods would have returned a simple
|
|
|
+ array of strings, each string attempting to present a single name, but
|
|
|
+ in reality this was unreliable since there is no rule governing the format
|
|
|
+ of RSS Author strings.
|
|
|
+ </para>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ The simplest method of simulating the original behaviour of these
|
|
|
+ methods is to use the <classname>Zend_Feed_Reader_Collection_Author</classname>'s
|
|
|
+ <methodname>getValues()</methodname> which also returns a simple array of strings
|
|
|
+ representing the "most relevant data", for authors presumed to be their name.
|
|
|
+ Each value in the resulting array is derived from the "name" value
|
|
|
+ attached to each Author (if present). In most cases this simple change is
|
|
|
+ easy to apply as demonstrated below.
|
|
|
+ </para>
|
|
|
+
|
|
|
+ <programlisting language="php"><![CDATA[
|
|
|
+/**
|
|
|
+ * Before 1.10
|
|
|
+ */
|
|
|
+
|
|
|
+$feed = Zend_Feed_Reader::import('http://example.com/feed');
|
|
|
+$authors = $feed->getAuthors();
|
|
|
+
|
|
|
+/**
|
|
|
+ * With 1.10
|
|
|
+ */
|
|
|
+$feed = Zend_Feed_Reader::import('http://example.com/feed');
|
|
|
+$authors = $feed->getAuthors()->getValues();
|
|
|
+]]></programlisting>
|
|
|
+ </sect2>
|
|
|
+
|
|
|
<sect2 id="migration.110.zend.file.transfer">
|
|
|
<title>Zend_File_Transfer</title>
|
|
|
<sect3 id="migration.110.zend.file.transfer.count">
|