ZF2-197: \Zend\Config\Factory::fromFile does not manage 'sections' for ini files ?


Hi there

\Zend\Config\Factory::fromFile does not manage 'sections' for ini files ?

How can i get config for my section "mysection" ?

$config = \Zend\Config\Factory::fromFile($myinifile);

array(14) {
  ["default"] => array(1) {
    ["application_upload_directory"] => string(6) "upload"
  ["en : default"] => array(0) {
  ["fr : default"] => array(0) {
  ["mysection : en"] => array(1) {
    ["keywords"] => array(1) {
      [0] => string(4) "test"


The concept of sections and inheritance was not carried over into Zend\Config 2.0. There are a few different approaches you can take instead (having multiple files merged over eachother by e.g. using fromFiles() and globbing, or, for your INI example, have an @include of a base config in the top each specific file and override specific values afterwards. For more help/information on this topic, check the mailing list or #zftalk.2 on irc.freenode.org.

Ok Thank you Ben. But i'm using a multi sites application and each section of my config file is a domain name (about 10 domains) so i don't want to create 10 config files per module. [toto.com : fr] [titi.net: en] ...

So i made of copy of Zend\Config from zf2beta2 to my own component library and i'm using it instead of the new config system.