1 - In your bootstrap, after loading Model module, write:
Kohana::$config->attach(new Config_File('config/'.$_SERVER['YOUR_ENV']));
2 - Create in folder config a subfolder "foobar" of the name $_SERVER['YOUR_ENV']
3 - Put in it your file > config/foobar/database.php | don't change "default" key
return array
(
'default' => array
(
// your config
)
)
4 - Set in apache :
SetEnv YOUR_ENV foobar
And it works !!