[Catalyst] A domain-cued application
Matt S Trout
dbix-class at trout.me.uk
Thu Apr 27 14:33:48 CEST 2006
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.
Ah, you didn't say it was going to be running under mod_perl. Since you were
saying it needed to be deployment-agnostic and be able to run under whatever
vhost required, I was expecting you to be using a FastCGI script in the vhost
directory somewhere.
> If so, yeah, that will work - I can set up a hash of data sources that
> looks at which virtual host the request came in for, and choses the
> right one.
If you're wanting to do that with a single process, I'd subclass
C::M::DBIC::Schema and make it create a $schema for each database, then select
which one to return at ACCEPT_CONTEXT time based on the $c.
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Catalyst
mailing list