Yeah if anyone find's a great way to do this .. lemme know. For me, I
just toss some if statements into my config that recongnize the url
and pick a db config based on it. Not the best idea.. I know.

I think *best* case scenario is to not commit the database config
file. And have deploy scripts to given servers generate the database
config file somehow. but that is a bit of work.

On Jan 8, 12:04 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Jan 8, 2008 1:39 PM, Alfredo <[EMAIL PROTECTED]> wrote:
>
> > Hi, I need to handle multiple environments (dev, qa, production...)
> > and for each I need a set of values, diffrent api keys,  base urls
> > resource locations etc.  Is there a way to define an array for each
> > environment and have an global environment_config array that can be
> > accessed from controllers/models/views? Is there a default technique
> > for this?
>
> While this is not a Cake-specific thing, I have done similar stuff by
> defining an Apache environment variable for each environment, then in
> my "load values depending on environment" section I would check the
> value of that variable.
>
> In Cake-1.2-specific terms, I imagine you'd need some code that would
> look at that environment variable and then load things into the
> Configure object:
>
> http://tempdocs.cakephp.org/#TOC33079
>
> Where that code should go, I don't know.  Perhaps in the
> beforeFilter() for AppController?
>
> Hope that helps.
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
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