[Catalyst] fix config right before database connect?

David Wright dave-catalyst at dexy.org
Mon Mar 24 11:38:42 GMT 2008


Hi,

> Hello!
> 
> I'm running several instances of Catalyst app (for every developer and 
> production) on the same box; I'm thinking of automatically patch 
> database name loaded from config file to allow separate copies of 
> databases to coexist transparently.

We have the same multi-instance set up, and instead of patching have two 
config files per instance. The first contains entries common to all, and 
the second adds in instance specific database connect info.

Catalyst will load any config named $myapp_foo. In this case, I doubt 
the order matters.

e.g.
cat conf/myapp_common.xml

<config>
   <name>Myapp</name>
   <log>conf/logging.conf</log>

   <model name="Core">
     <schema_class>Myapp::Schema::DB</schema_class>
   </model>
</config>

cat conf/myapp_perinstance.xml

<config>
   <name>Myapp</name>
   <model name="Core">    	
     <connect_info>dsn:blah/connect_info>
     <connect_info>monkey</connect_info>
     <connect_info>tennis</connect_info>
   </model>
</config>

HTH,
David




More information about the Catalyst mailing list