public
Last active

Load config based on Environment in Fuel

  • Download Gist
bootstrap.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<?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 */
config.php
PHP
1 2 3 4 5
/**
 
In your config file you would then set the environment to the ENV constant you defined in the bootstrap.
 
**/

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.