[Catalyst] ConfigLoader and merging _local

Christopher H. Laco claco at chrislaco.com
Tue May 23 02:18:16 CEST 2006


Adam Herzog wrote:
> 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

Sounds like a job for....gasp... Hash::Merge


-=Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060522/6d41e648/attachment.pgp 


More information about the Catalyst mailing list