Skip to content

Instantly share code, notes, and snippets.

@isaiahdw
Created December 1, 2011 21:30
Show Gist options
  • Save isaiahdw/1420019 to your computer and use it in GitHub Desktop.
Save isaiahdw/1420019 to your computer and use it in GitHub Desktop.
/**
* Attach a file reader to config. Multiple readers are supported.
*/
Kohana::$config = new Config;
Kohana::$config->attach(new Config_File);
/**
* Attach the environment specific configuration file reader to config if not in production.
*/
if (Kohana::$environment != Kohana::PRODUCTION)
{
Kohana::$config->attach(new Config_File('config/environments/'.$env));
}
@John2496
Copy link

John2496 commented Dec 1, 2011

Thx, I'm currently using... Kohana::$config->attach(new Config_File('config/environments/' . arr::get(array('production', 'staging', 'testing', 'development'), Kohana::$environment - 1)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment