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 -~----------~----~----~----~------~----~------~--~---
