Skip to content

Instantly share code, notes, and snippets.

@dhrrgn
Created May 2, 2011 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhrrgn/951075 to your computer and use it in GitHub Desktop.
Save dhrrgn/951075 to your computer and use it in GitHub Desktop.
Load config based on Environment in Fuel
<?php
/********** This is in app/bootstrap.php ************/
// Bootstrap the framework DO NOT edit this
require_once COREPATH.'bootstrap.php';
/**
* Set the timezone to what you need it to be.
*/
date_default_timezone_set('UTC');
/**
* Set the encoding you would like to use.
*/
Fuel::$encoding = 'UTF-8';
Autoloader::add_classes(array(
// Add classes you want to override here
// Example: 'View' => APPPATH.'classes/view.php',
));
// Register the autoloader
Autoloader::register();
// Define your environment here
define('ENV', Fuel::DEVELOPMENT);
// Initialize the framework with the correct config file.
Fuel::init(include(APPPATH.'config/'.ENV.'.php'));
/* End of file bootstrap.php */
/**
In your config file you would then set the environment to the ENV constant you defined in the bootstrap.
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment