[Catalyst] ConfigLoader and components

Matt S Trout dbix-class at trout.me.uk
Wed May 10 16:51:41 CEST 2006


Nathan Kurz wrote:
> On Tue, May 09, 2006 at 10:40:52PM -0600, Nathan Kurz wrote:
>> I've been beating my head against this for an hour now, and think I
>> must be missing something.  How can I use ConfigLoader to let me set
>> the database dsn in myapp.yml, and pass that along to the component
>> I'm deriving from Catalyst::Model::DBIC::Schema?
> 
> Silly me.  It turned out that I had deleted Makefile.PL to make the
> sample code simpler, and obviously this causes $config->{home} to be
> set one subdirectory deeper than it otherwise would.  So all I needed
> to do was move my app.yml file into 'lib' and things started working.
> 
> Nothing wasted by a few hours of my time... :(
> 
> By the way, why does Catalyst::Utils::home() rely on Makefile.PL?

It uses Makefile.PL if your app hasn't been installed into a site_perl 
tree, and figures things out from the tree structure otherwise. If your 
app hasn't been installed it seems a reasonable assumption that it's a 
development directory and as such will have a Makefile.PL so it *can* be 
installed when you're done with development.

Even if you're not planning to install the app as such, a Makefile.PL is 
still important as somewhere to encode dependencies in the usual way.



More information about the Catalyst mailing list