[Catalyst] A domain-cued application

Matt S Trout dbix-class at trout.me.uk
Thu Apr 27 14:06:58 CEST 2006

Matija Grabnar wrote:
> I'm developing a small application that we would like to sell (as a part 
> of a much larger package) to a number of customers. Most often, the 
> hosting for that customer will be done by us, in a vhost on one of our 
> servers. Since the load from the application will usualy be very small, 
> there is NO chance of setting up a separate server, (not even a separate 
> apache tree) for each customer.
> Idealy, I would like catalyst to look up the domain it's being used with 
> currently (on an apache with multiple vhosts instalation), and select 
> the appropriate database for that customer. That way, I can create the 
> application for a new customer by simply creating a new vhost and new 
> database for them, and the application can be very simple.
> Unfortunately, I can't see a way to do that with Catalyst and DBIx::Class.

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)

      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