[Catalyst] YAML Config
Adam Herzog
adam at herzogdesigns.com
Tue Jul 24 15:08:03 GMT 2007
On Jul 24, 2007, at 9:43 AM, Dave Howorth wrote:
> Oleg Pronin wrote:
>> How to use other variables' values in yaml config?
>
> I always end up implementing $substition (a la shell or perl) in my
> app.
I've used Config::General with variable interpolation to do this, in
the past.
Although Config::General is supported by Config::Any (and therefore
by Catalyst::Plugin::ConfigLoader, which I'm assuming we're talking
about), there isn't any mechanism to pass configuration to
Config::General when it's instantiated, so it doesn't interpolate by
default. I ended up creating my own Config::Any::General::Interpolate
which loads files called .cnfi or .confi, and tells Config::General
to interpolate the variables.
I think it would be better to have a mechanism in Config::Any to pass
configuration through to Config::General, but I never bothered to
come up with a patch or suggestion on how it should work. I guess
maybe I should. I think I've also seen some movement towards removing
YAML as the default config type, but maybe I just dreamed that.
-A
More information about the Catalyst
mailing list