migration-08.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="migration.08">
  4. <title>Zend Framework 0.8</title>
  5. <para>
  6. When upgrading from a previous release to Zend Framework 0.8 or higher you
  7. should note the following migration notes.
  8. </para>
  9. <sect2 id="migration.08.zend.controller">
  10. <title>Zend_Controller</title>
  11. <para>
  12. Per previous changes, the most basic usage of the <acronym>MVC</acronym> components
  13. remains the same:
  14. </para>
  15. <programlisting language="php"><![CDATA[
  16. Zend_Controller_Front::run('/path/to/controllers');
  17. ]]></programlisting>
  18. <para>
  19. However, the directory structure underwent an overhaul, several
  20. components were removed, and several others either renamed or added.
  21. Changes include:
  22. </para>
  23. <itemizedlist>
  24. <listitem>
  25. <para>
  26. <classname>Zend_Controller_Router</classname> was removed in favor of
  27. the rewrite router.
  28. </para>
  29. </listitem>
  30. <listitem>
  31. <para>
  32. <classname>Zend_Controller_RewriteRouter</classname> was renamed to
  33. <classname>Zend_Controller_Router_Rewrite</classname>, and promoted to
  34. the standard router shipped with the framework;
  35. <classname>Zend_Controller_Front</classname> will use it by default if
  36. no other router is supplied.
  37. </para>
  38. </listitem>
  39. <listitem>
  40. <para>
  41. A new route class for use with the rewrite router was
  42. introduced,
  43. <classname>Zend_Controller_Router_Route_Module</classname>; it covers
  44. the default route used by the <acronym>MVC</acronym>, and has support for <link
  45. linkend="zend.controller.modular">controller
  46. modules</link>.
  47. </para>
  48. </listitem>
  49. <listitem>
  50. <para>
  51. <classname>Zend_Controller_Router_StaticRoute</classname> was renamed
  52. to <classname>Zend_Controller_Router_Route_Static</classname>.
  53. </para>
  54. </listitem>
  55. <listitem>
  56. <para>
  57. <classname>Zend_Controller_Dispatcher</classname> was renamed
  58. <classname>Zend_Controller_Dispatcher_Standard</classname>.
  59. </para>
  60. </listitem>
  61. <listitem>
  62. <para>
  63. <methodname>Zend_Controller_Action::_forward()</methodname>'s arguments
  64. have changed. The signature is now:
  65. </para>
  66. <programlisting language="php"><![CDATA[
  67. final protected function _forward($action,
  68. $controller = null,
  69. $module = null,
  70. array $params = null);
  71. ]]></programlisting>
  72. <para>
  73. <varname>$action</varname> is always required; if no controller is
  74. specified, an action in the current controller is assumed.
  75. <varname>$module</varname> is always ignored unless
  76. <varname>$controller</varname> is specified. Finally, any
  77. <varname>$params</varname> provided will be appended to the
  78. request object. If you do not require the controller or
  79. module, but still need to pass parameters, simply specify
  80. <constant>NULL</constant> for those values.
  81. </para>
  82. </listitem>
  83. </itemizedlist>
  84. </sect2>
  85. </sect1>
  86. <!--
  87. vim:se ts=4 sw=4 et:
  88. -->