migration-16.xml 4.1 KB

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