Read this today:
switch($_SERVER['SERVER_NAME']){
case ‘digbiz.localhost’:
$this->default = $this->dev;
break;
case ‘digbiz.example.com’:
$this->default = $this->prod;
break;
default:
// we are likely baking, use our local db
$this->default = $this->dev;
}
via
http://edwardawebb.com/programming/php-programming/cakephp/automatically-choose-database-connections-cakephp
My own solution, since I am using code.google.com for some of my
projects:
database.php:
<?php
include dirname(__FILE__) . '/../../database_site.php';
?>
Moving my database settings out of the app directory
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---