Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Dec 6, 2013

Conversation

Projects
None yet
2 participants
Contributor

michaelmoussa commented Nov 30, 2013

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

Fixed boolean/integer BC break.
Booleans and integers were being inadvertently converted to strings when
saved in the config array. This preserves the datatype.

@michaelmoussa michaelmoussa referenced this pull request in zfcampus/zf-apigility-admin Nov 30, 2013

Closed

Updated Apigility Admin to allow setting of the default API version #27

weierophinney added a commit that referenced this pull request Dec 6, 2013

Merge pull request #5569 from michaelmoussa/readable-config-arrays
Fixed boolean/integer BC break in Zend\Config\Writer\PhpArray

weierophinney added a commit that referenced this pull request Dec 6, 2013

[#5569] CS fixes
- 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

1 check failed

default The Travis CI build failed
Details

@ghost ghost assigned weierophinney Dec 6, 2013

@michaelmoussa michaelmoussa deleted the michaelmoussa:readable-config-arrays branch Dec 7, 2013

@weierophinney weierophinney commented on the diff Dec 7, 2013

library/Zend/Config/Writer/PhpArray.php
$arrayString .= "'" . addslashes($value) . "',\n";
+ } else {
+ $arrayString .= $value . ",\n";
@weierophinney

weierophinney Dec 7, 2013

Owner

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.

@michaelmoussa

michaelmoussa Dec 8, 2013

Contributor

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

weierophinney added a commit that referenced this pull request Dec 7, 2013

[#5569] Handle null values properly
- 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

Merge pull request zendframework/zendframework#5569 from michaelmouss…
…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

[zendframework/zendframework#5569] Handle null values properly
- 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 join this conversation on GitHub. Already have an account? Sign in to comment