Sounds like you want to use multiple configurations based on the
location of the app (live versus dev)

There are a few ways to solve this. I wrote an article outlining my
preferred method.

You should read through the user comments as they add some helpful
insight, including how to use this method while still allowing the
bake commands to work.

http://edwardawebb.com/programming/php-programming/cakephp/automatically-choose-database-connections-cakephp

On Jan 2, 11:48 am, james revillini <ja...@revillini.com> wrote:
> I'm debating whether or not this is a bug.  What do you think:
>
> If I use the bake script and create a database conf called "local",
> then run it again and create one called "live", then start trying to
> build models, it will fail with this error message:
>
> Fatal error: ConnectionManager::getDataSource - Non-existent data
> source default in C:\tmp\1.2.x.x\cake\libs\model
> \connection_manager.php on line 109
>
> The exact step of model building that it will fail on is right after
> you answer the question about adding validation criteria for the model
> fields.  I'm guessing cake is hard coded to use "default" somewhere,
> but I think it's a bug since it did ask me which db config to use and
> I told it to use the "local" one at the outset of running the bake
> script.
>
> Incidentally, the work around is to create a db config for default,
> and make sure it points to the database that has the correct structure
> for your bake.  Another option is to turn it into a drinking game,
> where you need to chug every time you get a fatal error, and
> eventually the situation will smooth itself out.
>
> Thanks,
> Jim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to