David Wright <[EMAIL PROTECTED]> writes: >> 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.
But since the config file can't be dynamic, it's a little annoying. Another easy option would be to use Catalyst::Plugin::ConfigLoader::Environment and have people stick something like this in .bashrc: export MYAPP_Model__AppDB_connect_info}='["dsn:foo","peanut","butter"]' Or have a convention and stick this in /etc/bashrc export MYAPP_Model__AppDB_connect_info="['dsn:mysql:test_$USER','root','']" But if you really want to do it dynamically in code, its probably most easily done in your Model class; just override new and set the connect_info to whatever you like. _______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
