summaryrefslogtreecommitdiffstats
path: root/user_guide/libraries/config.html
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-03-09 11:08:36 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-03-09 11:08:36 +0100
commit93ca71552d9a3e28eeaa00dd10755d20b2cbf32e (patch)
tree660233f2ec631e5730731491d2fd244fe15f7df8 /user_guide/libraries/config.html
parenta9924b8352aa18869677bea0182c45e2a7e2ce37 (diff)
parent2f8b27efeb0a39c24eddf89cf31ea0fd113a6b71 (diff)
Merged recent Core changes and fixed conflict.
Diffstat (limited to 'user_guide/libraries/config.html')
-rw-r--r--user_guide/libraries/config.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html
index 6b48b2515..98b6052a9 100644
--- a/user_guide/libraries/config.html
+++ b/user_guide/libraries/config.html
@@ -150,6 +150,23 @@ $site_name = $blog_config['site_name'];</code>
<p>Where <var>item_name</var> is the $config array index you want to change, and <var>item_value</var> is its value.</p>
+<h2>Environments</h2>
+
+<p>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 <strong>index.php</strong>, located at the root and change the <var>ENVIRONMENT</var> constant. By default, there is support for a development, test and production environment.</p>
+
+<code>
+define('<var>ENVIRONMENT</var>', '<var>development</var>');
+</code>
+
+<p>To make a config file environment-aware, copy the file from <samp>application/config/</samp> to <samp>application/config/development/</samp>, depending on the environment the config file belongs to. You can place the following configuration files in environment folders:</p>
+
+<ul>
+<li>Default config files</li>
+<li>Database config files</li>
+<li>Custom config files</li>
+</ul>
+
+<p><strong>Note:</strong> 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. <samp>application/config/</samp>) is loaded. This means you are not obligated to place <strong>all</strong> your config files (but rather the files that change per environment) in an environment folder.</p>
<h2>Helper Functions</h2>