[ZF-10089] Zend_Log
[zend.git] / documentation / manual / en / ref / migration-16.xml
blobcfa0e3175b9c0455b712128ec192076856a3f5e8
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Reviewed: no -->
3 <sect1 id="migration.16">
4     <title>Zend Framework 1.6</title>
6     <para>
7         When upgrading from a previous release to Zend Framework 1.6 or higher you
8         should note the following migration notes.
9     </para>
11     <sect2 id="migration.16.zend.controller">
12         <title>Zend_Controller</title>
14         <sect3 id="migration.16.zend.controller.dispatcher">
15             <title>Dispatcher Interface Changes</title>
17             <para>
18                 Users brought to our attention the fact that
19                 <classname>Zend_Controller_Front</classname> and
20                 <classname>Zend_Controller_Router_Route_Module</classname> were each
21                 using methods of the dispatcher that were not in the dispatcher
22                 interface. We have now added the following three methods to
23                 ensure that custom dispatchers will continue to work with the
24                 shipped implementations:
25             </para>
27             <itemizedlist>
28                 <listitem>
29                     <para>
30                         <methodname>getDefaultModule()</methodname>: should return the name of
31                         the default module.
32                     </para>
33                 </listitem>
35                 <listitem>
36                     <para>
37                         <methodname>getDefaultControllerName()</methodname>: should return the
38                         name of the default controller.
39                     </para>
40                 </listitem>
42                 <listitem>
43                     <para>
44                         <methodname>getDefaultAction()</methodname>: should return the
45                         name of the default action.
46                     </para>
47                 </listitem>
48             </itemizedlist>
49         </sect3>
50     </sect2>
52     <sect2 id="migration.16.zend.file.transfer">
53         <title>Zend_File_Transfer</title>
55         <sect3 id="migration.16.zend.file.transfer.validators">
56             <title>Changes when using validators</title>
58             <para>
59                 As noted by users, the validators from <classname>Zend_File_Transfer</classname>
60                 do not work the same way like the default ones from
61                 <classname>Zend_Form</classname>. <classname>Zend_Form</classname> allows the usage
62                 of a <varname>$breakChainOnFailure</varname> parameter which breaks the validation
63                 for all further validators when an validation error has occurred.
64             </para>
66             <para>
67                 So we added this parameter also to all existing validators from
68                 <classname>Zend_File_Transfer</classname>.
69             </para>
71             <itemizedlist>
72                 <listitem>
73                     <para>
74                         Old method <acronym>API</acronym>: <methodname>addValidator($validator,
75                             $options, $files)</methodname>.
76                     </para>
77                 </listitem>
79                 <listitem>
80                     <para>
81                         New method <acronym>API</acronym>: <methodname>addValidator($validator,
82                             $breakChainOnFailure, $options, $files)</methodname>.
83                     </para>
84                 </listitem>
85             </itemizedlist>
87             <para>
88                 To migrate your scripts to the new <acronym>API</acronym>, simply add a
89                 <constant>FALSE</constant> after defining the wished validator.
90             </para>
92             <example id="migration.16.zend.file.transfer.example">
93                 <title>How to change your file validators from 1.6.1 to 1.6.2</title>
95                 <programlisting language="php"><![CDATA[
96 // Example for 1.6.1
97 $upload = new Zend_File_Transfer_Adapter_Http();
98 $upload->addValidator('FilesSize', array('1B', '100kB'));
100 // Same example for 1.6.2 and newer
101 // Note the added boolean false
102 $upload = new Zend_File_Transfer_Adapter_Http();
103 $upload->addValidator('FilesSize', false, array('1B', '100kB'));
104 ]]></programlisting>
105         </example>
106         </sect3>
107     </sect2>
108 </sect1>
109 <!--
110 vim:se ts=4 sw=4 et: