Bug with Phalcon\Config ? (not sure, but seems a bit odd)

Hi all,

I'm building an app that has 2 sets of config parameters:

  • A first set loaded from an INI file with \Phalcon\Config\Adapter\Ini (platfom config)
  • And a second one coming dynamically from the database. This second config is loaded into a \Phalcon\Config

Funny behaviour when I try to merge those 2 objects using the provided "merge" method:

$oDynConf->merge($oIniConf); ==> works fine.

$oIniConf->merge($oDynConf); ==> Invalid callback Phalcon\Config\Adapter\Ini::_merge, cannot access private method Phalcon\Config\Adapter\Ini::_merge() in /data/www/nis/app/config/dynamic-config.php at line 37

Am I doing something wrong or is there a scope issue there. Seems like despite inheriting from \Phalcon config, the \adapter can merge properly.




adapter  = Mysql
host     = localhost
username = scott
password = cheetah
dbname     = test_db

controllersDir = "../app/controllers/"
modelsDir      = "../app/models/"
viewsDir       = "../app/views/"

metadata.adapter  = "Memory"


$ini = new \Phalcon\Config\Adapter\Ini("config.ini");

$arr = new \Phalcon\Config(array(
    'database' => array(
        'username' => 'scott',
        'password' => 'secret',



Works just fine in 1.3.3 .


Hi Calin,

Thanks for testing, that's exaclty what I'm trying to do. Well almost: the process is the same, but I have parameters in my second Config object that don't exist in the first one.

Plus I should have mentioned it before, I'm using version 2.


"but I have parameters in my second Config object " - does not matter. When you merg A + B if you have params that exists in A but not in B or viceversa thoes params will remain there.

I don't have any test env for 2.0 ...