[Catalyst] Working with project configurationfileoutsideofCatalyst directory

Alexander Hartmaier alexander.hartmaier at t-systems.at
Wed Sep 15 15:58:04 GMT 2010


I'd suggest to remove the db connection settings from the myapp.conf
file entirely and create one additional config file with just the prod
db settings and one for the test db.
You control with *additional* config file is loaded with the
MYAPP_CONFIG_LOCAL_SUFFIX env var.

When you set this env var to 'testing' in your testing file (or better
library included in every test file) you prevent to ever run the test
code against the prod db...yes that happens... ;-(

--
Best regards, Alex


Am Sonntag, den 05.09.2010, 08:58 +0200 schrieb Octavian Rasnita:
> Hi Leandro,
>
> Have you tried to use in your main configuration file something like:
>
> <MyDB>
> <<include db.conf>>
> </MyDB>
>
> and in your Catalyst configuration file something like:
>
> <Model::DB>
> <<include db.conf>>
> </Model::DB>
>
> and in the db.conf:
>
>    schema_class ...
>    <connect_info>
>        dsn ...
>        username ...
>        password ...
>        AutoCommit 1
>    </connect_info>
>
> Octavian
>
> ----- Original Message -----
> From: "Leandro Hermida" <softdev at leandrohermida.com>
> To: "The elegant MVC web framework" <catalyst at lists.scsys.co.uk>
> Sent: Sunday, September 05, 2010 2:14 AM
> Subject: Re: [Catalyst] Working with project configurationfileoutsideofCatalyst directory
>
>
> > Hi there,
> >
> > But none of these solutions solve the problem I mentioned in my
> > earlier email.  If for example you have your database connection
> > information in the parent project configuration file which would be
> > common since many things outside of Catalyst need to access the
> > database and in this file you would have it look like this:
> >
> > <MyDB>
> >   schema_class ...
> >   <connect_info>
> >       dsn ...
> >       username ...
> >       password ...
> >       AutoCommit 1
> >   </connect_info>
> > </MyDB>
> >
> > And in the Catalyst configuration file if you include the parent
> > config it won't work since Catalyst::Model::DBIC::Schema seems to need
> > the enclosing tags to start with Model:: i.e. <Model::MyDB>
> > </Model::MyDB>.  Of course it doesn't make sense to use such tags in
> > the parent configuration.
> >
> > Does anyone know of a way to have Catalyst::Model::DBIC::Schema look
> > for a different set of tags in the Config::General file?
> >
> > best,
> > Leandro
> >
> > _______________________________________________
> > List: Catalyst at lists.scsys.co.uk
> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> > Dev site: http://dev.catalyst.perl.org/
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*



More information about the Catalyst mailing list