[Catalyst] ConfigLoader and merging _local

Adam Herzog adam at herzogdesigns.com
Tue May 23 01:37:44 CEST 2006


When using C::P::ConfigLoader and the _local configuration, I
encountered some counter-intuitive behavior (for me at least.)

The files myapp.yml and myapp_local.yml are merged on a per-section
basis, but not within sections. So, if I have the following configs:

myapp.yml
---
View::TT:
    CATALYST_VAR: Catalyst
    TIMER: 0

myapp_local.yml
---
View::TT:
    TIMER: 1

Then I get the result configuration of:
Resulting configuration:
'View::TT' => {
    'TIMER' => '1'
},

I had expected TIMER to be overridden by my _local configuration, but
CATALYST_VAR to stay the same. This would also be true if I had, for
instance, set a new dsn for my model, but didn't copy over the rest of
the model's configuration.

So, I'm thinking that ConfigLoader should try to merge the
configurations as deeply as possible, with myapp_local.yml overriding
myapp.yml where necessary.

Thoughts or suggestions?

-Adam



More information about the Catalyst mailing list