From 42aa95bfee77baa6d4fe2728c4a02c61b7a3cac1 Mon Sep 17 00:00:00 2001
From: joelcox CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.).
-The config file is located at: application/config/database.phpDatabase Configuration
The config settings are stored in a multi-dimensional array with this prototype:
diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index bfb679457..10892de38 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -150,6 +150,23 @@ $site_name = $blog_config['site_name'];Where item_name is the $config array index you want to change, and item_value is its value.
+You can set the environment of you application and load config items depending on the current environment. It also disables PHP from displaying errors in environments other than development. To set your environment, open index.php, located at the root and change the ENVIRONMENT constant. By default, there is support for a development, test and production environment.
+ +
+define('ENVIRONMENT', 'development');
+
+
+To make a config file environment-aware, copy the file from application/config/ to application/config/development/, depending on the environment the config file belongs to. You can place the following configuration files in environment folders:
+ +Note: CodeIgniter always tries to load the config file for the current environment first. If the file does not exist, the global config file (i.e. application/config/) is loaded. This means you are not obligated to place all your config files (but rather the files that change per environment) in an environment folder.