The easiest technique I've seen used an additional to the database.php
in app/config, which sets the DB config based on the host. There's
some code floating around somewhere, but I can't remember where the
link was at the moment. Perhaps someone else knows what I'm talking
about!

On Jun 5, 3:34 am, LePetitNicolas <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would use the AppModel as mentioned before.
>
> A simple approach (in Cake 1.1.x.x) :
>
> Define a constant in your app/bootstrap.php file
> <code>
> //...
> define('DEV_HTTP_HOST', 'example.dev');
> //...
> </code>
>
> and then set $useDbConfig in your AppModel
> <code>
> function __construct()
> {
> //...
> if ($_SERVER['HTTP_HOST'] == DEV_HTTP_HOST)
> {
> $this->useDbConfig = 'development_connection';}
>
> //...
> parent::__construct();}
>
> </code>
>
> Hope this helps!
>
> On Jun 4, 11:52 pm, PiLLo <[EMAIL PROTECTED]> wrote:
> ...


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