[Catalyst] A domain-cued application

Yuval Kogman nothingmuch at woobling.org
Thu Apr 27 14:41:13 CEST 2006


On Thu, Apr 27, 2006 at 15:20:42 +0200, Matija Grabnar wrote:
> Matt S Trout wrote:
> > ConfigLoader finds a relative config file and loads it into the package config 
> > during setup. That would work, or you could adapt the approach and incorporate 
> > environment-based info into how you generate the config (there's still a 
> > question of where you'd get the password from in that case though)
> >
> >   
> I didn't realize the config gets loaded every time a request is received.
> I had this vague notion that the config only happens when a mod_perl 
> process first gets initialized.

It doesn't - only on ->setup.

I think Matt meant that you ought to deploy several apps with the
same code and different configurations on different vhosts.

Alternatively you might be able to come up with a scheme where the
controller stuff is all identical, but at runtime you simply switch
models:

Define ACCEPT_CONTEXT in your model to return something that is
sensitive to $c->request->uri->host, by hooking up with a different
schema.

You can probably write this as a model that delegates to
DBIC::Schema.

Note that your authentication/caches/etc will all have to be dealt
with in similar ways. If this is a non issue, perhaps it is easier
than multiple instances and different configs on apache vhosts.

-- 
  Yuval Kogman <nothingmuch at woobling.org>
http://nothingmuch.woobling.org  0xEBD27418

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060427/627c1d5e/attachment.pgp 


More information about the Catalyst mailing list