Issues

ZF2-309: support of [] operator in nested ini config

Issue Type: Improvement Created: 2012-05-18T20:07:04.000+0000 Last Updated: 2012-08-25T08:09:04.000+0000 Status: Resolved Fix version(s): Reporter: Christian R (foobarbar) Assignee: Ben Scholzen (dasprid) Tags: - Zend\Config

  • []-operator
  • config
  • ini
  • zend

Related issues: Attachments:

Description

Example:

<pre class="highlight">foo.bar = foobar
foobar[] = foobarArray
foo.baz[] = foobaz1
foo.baz[] = foobaz2

Expected:

<pre class="highlight">
array (
  'foo' =>
  array (
    'bar' => 'foobar',
    'baz' =>
    array (
      0 => 'foobaz1',
      1 => 'foobaz2',
    ),
  ),
  'foobar' =>
  array (
    0 => 'foobarArray',
  )
)

Actual:

<pre class="highlight">array (
  'foo' => 
  array (
    'bar' => 'foobar',
  ),
  'foobar' => 
  array (
    0 => 'foobarArray',
  ),
  'foo.baz' => 
  array (
    0 => 'foobaz1',
    1 => 'foobaz2',
  ),
)

I just rewrote the application.config.php of an example ZF2 project into the INI equivalent (or what I thought would be). I was pretty much confused that the nested part (foo.baz) was not resolved correctly. Is that for any specific/important reason? Could we add this as an improvement?

Comments

Posted by Robert Boloc (robertboloc) on 2012-08-24T10:04:15.000+0000

pull request: https://github.com/zendframework/zf2/pull/2233

Posted by Maks 3w (maks3w) on 2012-08-25T08:09:04.000+0000

Patch merged. Thank you for your contribution

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts