zendframework / zend-servicemanager

ServiceManager component from Zend Framework
BSD 3-Clause "New" or "Revised" License
188 stars 89 forks source link

Bug with array_merge_recursive #279

Open thomasvargiu opened 5 years ago

thomasvargiu commented 5 years ago

I'm trying to do something like this:

$config1 = [
    'factories`=> [
        // factories
    ],
    'lazy_services' => [
        'class_map' => [
            'Foo' => 'Foo',
        ],
    ],
];
$config2 = [
    'factories`=> [
        // factories
    ],
    'lazy_services' => [
        'class_map' => [
            'Foo' => 'Foo',
        ],
    ],
];

$container = new ServiceManager($config1);
$container->configure($config2);

This will result on internal lazy_services property the following:

$this->lazy_services = [
    'class_map' => [
        'Foo' => [
            'Foo',
            'Foo',
        ],
    ].
];

The problem is the use of array_merge_recursive() function in this line.

Same problem with delegators property.

I found this issue using zend-mvc and an already configured container, then Zend\ModuleManager\Listener\ServiceListener reconfigure it adding configuration from ModuleManager features.

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-servicemanager; a new issue has been opened at https://github.com/laminas/laminas-servicemanager/issues/4.