Saturday
18
October
2008

I18N compatibility mode

Hy interested ones,

to prevent problems when you want to change from Zend Framework 1.6 to 1.7 I added a so called “compatibility mode”.

It’s simply a static variable which changes between old API and new API behaviour.
Within release 1.7 the old behaviour is per default active (true).
So your old code will still work with this settings but it will throw a user warning.

You can change this mode by simply setting it to false in your bootstrap.

Zend_Locale::$compatibilityMode = false;

This will no longer return user warnings, but could be in a position where you have to change your code to work again. See the migration chapter of Zend_Locale for details.

The changes include:
* changes on isLocale which now only returns boolean
* changes on getDefault which returns only the framework default
* changes on calling information methods which were made static
* changes on returned locales which do no longer degrade to other types

In 75% of the cases you will not have to change anything. But you should properly check this.

With the next release 1.8 we will change the compatibility mode to false per default, and with 1.9 we will delete it completly so only the new API behaviour is active.

Greetings
Thomas Weidner
I18N Team Leader, Zend Framework

Zend Framework Advisory Board Member
Zend Certified Engineer for Zend Framework

Back to top
Sunday
5
October
2008

Migrating your Script using Zend_File_Transfer from 1.6.1 to a newer release

Hy interested ones,

most of you know this already. But it seems that users tend not to read migration notes so I will say it once more here.

When you are using Zend_File_Transfer in conjunction with validations you will have to note that the API has changed.

I added a $breakChainOnFailure parameter which allows to break the validation chain for further validators if a validation error occurs.

To give you an example:

// Example for 1.6.1 or earlier
$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'));

So as conclusio for you:
If you have to migrate old scripts simply add a boolean false after the validator name.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework

Back to top