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

Fixed boolean/integer BC break in Zend\Config\Writer\PhpArray #5569

Merged
merged 1 commit into from
Dec 6, 2013
Merged

Fixed boolean/integer BC break in Zend\Config\Writer\PhpArray #5569

merged 1 commit into from
Dec 6, 2013

Conversation

michaelmoussa
Copy link
Contributor

I realized I accidentally broke BC with the readable format config array PR. This is a simple fix that will preserve the config value's datatype when it isn't a string.

See PR 5259

Booleans and integers were being inadvertently converted to strings when
saved in the config array. This preserves the datatype.
weierophinney added a commit that referenced this pull request Dec 6, 2013
Fixed boolean/integer BC break in Zend\Config\Writer\PhpArray
weierophinney added a commit that referenced this pull request Dec 6, 2013
- elseif -> else if
weierophinney added a commit that referenced this pull request Dec 6, 2013
@weierophinney weierophinney merged commit 20b30b9 into zendframework:develop Dec 6, 2013
@ghost ghost assigned weierophinney Dec 6, 2013
@michaelmoussa michaelmoussa deleted the readable-config-arrays branch December 7, 2013 14:14
$arrayString .= "'" . addslashes($value) . "',\n";
} else {
$arrayString .= $value . ",\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case creates a new issue; null values now result in invalid configuration like this:

'some_key' => ,

I'm going to apply a patch shortly that fixes that situation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry I missed that. Thanks for catching it!

weierophinney added a commit that referenced this pull request Dec 7, 2013
- Previous fix led to:
  ```php
  'null' => ,
  ```
- Fix properly echoes the null value:
  ```php
  'null' => null,
  ```
weierophinney added a commit that referenced this pull request Dec 7, 2013
weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
…a/readable-config-arrays

Fixed boolean/integer BC break in Zend\Config\Writer\PhpArray
weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
- Previous fix led to:
  ```php
  'null' => ,
  ```
- Fix properly echoes the null value:
  ```php
  'null' => null,
  ```
weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants