OK, both pretty good ways of doing this, it seems I'll have to use one
of them. I think either way I'll have to write a vendor class to
handle the DDC, and use that class within the given part of the code.
Which is fine.

I'm leaning towards AD7six method because I like the idea of adding to
id to handle Production/Dev envirnments. Though I'm not fully sure
since there are other areas of the app that will need to be configed
when it comes to switching the envirnonment.

Thanks, if anyone else has any ideas, feel free to post then, I'd love
to read them.

On Mar 15, 2:12 am, "AD7six" <[EMAIL PROTECTED]> wrote:
> On Mar 14, 11:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:> How 
> dynamic does your DDC need to be? I guess the question is, are you
> > building the connection based on user input and controller logic? If
> > not you can build whatever you need in the config/database.php file.
>
> > I replaced database.php with this code, and then created
> > database_production.php and database_testing.php.
>
> > if( stristr($_SERVER['HTTP_HOST'],'productionDomainName.com')) {
> >         include('database_production.php');}else{
>
> >         include('database_testing.php');}
>
> Or put the logic in the constructor method for the DATABASE_CONFIG
> class, such that it sets the var $default to be the 'default'
> connection from the beginning.
>
> There's some outdated code in this example but it'll work and is
> something to start 
> with:http://www.noswad.me.uk/MiBlog/Blogs/view/SwitchConstants
>
> HTH,
>
> AD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to