Zend Framework 1.6

When upgrading from a previous release to Zend Framework 1.6 or higher you should note the following migration notes.

Zend_Controller

Dispatcher Interface Changes

Users brought to our attention the fact that Zend_Controller_Front and Zend_Controller_Router_Route_Module were each using methods of the dispatcher that were not in the dispatcher interface. We have now added the following three methods to ensure that custom dispatchers will continue to work with the shipped implementations:

  • getDefaultModule(): should return the name of the default module.
  • getDefaultControllerName(): should return the name of the default controller.
  • getDefaultAction(): should return the name of the default action.

Zend_File_Transfer

Changes when using validators

As noted by users, the validators from Zend_File_Transfer do not work the same way like the default ones from Zend_Form. Zend_Form allows the usage of a $breakChainOnFailure parameter which breaks the validation for all further validators when an validation error has occurred.

So we added this parameter also to all existing validators from Zend_File_Transfer.

  • Old method API: addValidator($validator, $options, $files).
  • New method API: addValidator($validator, $breakChainOnFailure, $options, $files).

To migrate your scripts to the new API, simply add a FALSE after defining the wished validator.

How to change your file validators from 1.6.1 to 1.6.2

1
2
3
4
5
6
7
8
// Example for 1.6.1
$upload = new Zend_File_Transfer_Adapter_Http();
$upload->addValidator('FilesSize', array('1B', '100kB'));

// Same example for 1.6.2 and newer
// Note the added boolean false
$upload = new Zend_File_Transfer_Adapter_Http();
$upload->addValidator('FilesSize', false, array('1B', '100kB'));

Project Versions

Table Of Contents

This Page

Note: You need to stay logged into your GitHub account to contribute to the documentation.

Edit this document

Edit this document

The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.

  1. Login with your GitHub account.
  2. Go to Zend Framework 1.6 on GitHub.
  3. Edit file contents using GitHub's text editor in your web browser
  4. Fill in the Commit message text box at the end of the page telling why you did the changes. Press Propose file change button next to it when done.
  5. On Send a pull request page you don't need to fill in text anymore. Just press Send pull request button.
  6. Your changes are now queued for review under project's Pull requests tab on GitHub.