We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

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');

Returns Phalcon\Config Object which is fine.

$moduleConfig = require __DIR__.'/config/config.php';

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);

returns null

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


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