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