Config merge

Hi, I'm having an issue with merging configs.

I have global config which is shared in my service container. I'm also using multi module structure. In my Module.php file I have

$config = $di->get('config');
print_r($config);

Returns Phalcon\Config Object which is fine.

$moduleConfig = require __DIR__.'/config/config.php';
print_r($moduleConfig);

Returns Phalcon\Config Object which is also fine.

Now I'm trying to merge these two config objects to have a global config.

$globalConfig = $config->merge($moduleConfig);
print_r($globalConfig);

returns null

What am I doing wrong? How to merge these two configs?



4.4k

Just use $config for further processing. The changes should be there. I think merge() has return type void.