Created
May 2, 2011 01:32
-
-
Save dhrrgn/951075 to your computer and use it in GitHub Desktop.
Load config based on Environment in Fuel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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