summaryrefslogtreecommitdiffstats
path: root/user_guide/libraries/config.html
diff options
context:
space:
mode:
authorjoelcox <joel@mickly.com>2011-01-16 18:16:21 +0100
committerjoelcox <joel@mickly.com>2011-01-16 18:16:21 +0100
commit42aa95bfee77baa6d4fe2728c4a02c61b7a3cac1 (patch)
tree7f53e7e600e7379fbd3d71e11b36b90317076b98 /user_guide/libraries/config.html
parent2035fd8f700c12ca6b21cacf9d1bbb111995a1af (diff)
Added documentation for environments
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 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'];</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>