Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
[#3404] Better description of change
Browse files Browse the repository at this point in the history
- Detailed the reason for the change, provided code samples of affected an
  unaffected code, and expanded descriptions.
  • Loading branch information
weierophinney committed Jan 11, 2013
1 parent c705251 commit aff9574
Showing 1 changed file with 46 additions and 8 deletions.
54 changes: 46 additions & 8 deletions README.md
Expand Up @@ -7,20 +7,58 @@ Develop: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?bra

*Zend Framework 2.1.0dev*

This is the first minor (feature) release for the 2.0 series.
This is the first minor (feature) release for the version 2 series.

DD Mmm YYYY

### UPDATES IN 2.1.0

#### Backwards Compatibility Break: Session Storage
The default session storage object has changed to an array adapter; this
is a minimal break in compatibility. Most developers are not working
directly with the storage object, but rather a Container, therefore switching
out the default will not change anything for those developers.
For those who are using it directly:
* Register the old SessionStorage object explicitly, or
* Do not utilize object notation for accessing members of the Storage object.

The default session storage object has changed from
`Zend\Session\Storage\SessionStorage` to an array adapter
(`Zend\Session\Storage\SessionArrayStorage`; this is a minimal break in
compatibility. Most developers are not working directly with the storage
object, but rather a `Zend\Session\Container`; as a result, switching out the
default will not cause compatibility problems for most developers.

The change was introduced to alleviate issues when working with 3rd party
libraries that access nested members of the `$_SESSION` superglobal.

Those affected will be those (a) directly accessing the storage instance, and
(b) using object notation to access session members:

```php
$foo = null;

/** @var $storage Zend\Session\Storage\SessionStorage */
if (isset($storage->foo)) {
$foo = $storage->foo;
}
```

If you are using array notation, as in the following example, your code remains
forwards compatible:

```php
$foo = null;

/** @var $storage Zend\Session\Storage\SessionStorage */
if (isset($storage['foo'])) {
$foo = $storage['foo'];
}
```

If you are not working directly with the storage instance, you will be
unaffected.

For those affected, the following courses of action are possible:

- Update your code to replace object property notation with array notation, OR
- Initialize and register a `Zend\Session\Storage\SessionStorage` object
explicitly with the session manager instance.

#### Other updates in 2.1.0

Please see CHANGELOG.md.

Expand Down

0 comments on commit aff9574

Please sign in to comment.