1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="migration.16">
4 <title>Zend Framework 1.6</title>
7 When upgrading from a previous release to Zend Framework 1.6 or higher you
8 should note the following migration notes.
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>
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:
30 <methodname>getDefaultModule()</methodname>: should return the name of
37 <methodname>getDefaultControllerName()</methodname>: should return the
38 name of the default controller.
44 <methodname>getDefaultAction()</methodname>: should return the
45 name of the default action.
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>
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.
67 So we added this parameter also to all existing validators from
68 <classname>Zend_File_Transfer</classname>.
74 Old method <acronym>API</acronym>: <methodname>addValidator($validator,
75 $options, $files)</methodname>.
81 New method <acronym>API</acronym>: <methodname>addValidator($validator,
82 $breakChainOnFailure, $options, $files)</methodname>.
88 To migrate your scripts to the new <acronym>API</acronym>, simply add a
89 <constant>FALSE</constant> after defining the wished validator.
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[
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'));