summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/general/environments.rst
diff options
context:
space:
mode:
authorEric Barnes <eric@ericlbarnes.com>2011-11-27 06:30:22 +0100
committerEric Barnes <eric@ericlbarnes.com>2011-11-27 06:30:22 +0100
commit7e66dda705743cbfe1d522ddb73e5694006ec42c (patch)
treec08b63deb28c09ec49d9173280f1ca234debfe50 /user_guide_src/source/general/environments.rst
parent7eceb03f083643254c7393c6b5ebe539e344a1ba (diff)
parente101593561a10632c1d63180436b19f1d7115046 (diff)
Merge branch 'refs/heads/develop' into feature/unit-tests
Conflicts: user_guide/helpers/number_helper.html
Diffstat (limited to 'user_guide_src/source/general/environments.rst')
-rw-r--r--user_guide_src/source/general/environments.rst46
1 files changed, 46 insertions, 0 deletions
diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst
new file mode 100644
index 000000000..40725feba
--- /dev/null
+++ b/user_guide_src/source/general/environments.rst
@@ -0,0 +1,46 @@
+##############################
+Handling Multiple Environments
+##############################
+
+Developers often desire different system behavior depending on whether
+an application is running in a development or production environment.
+For example, verbose error output is something that would be useful
+while developing an application, but it may also pose a security issue
+when "live".
+
+The ENVIRONMENT Constant
+========================
+
+By default, CodeIgniter comes with the environment constant set to
+'development'. At the top of index.php, you will see::
+
+ define('ENVIRONMENT', 'development');
+
+In addition to affecting some basic framework behavior (see the next
+section), you may use this constant in your own development to
+differentiate between which environment you are running in.
+
+Effects On Default Framework Behavior
+=====================================
+
+There are some places in the CodeIgniter system where the ENVIRONMENT
+constant is used. This section describes how default framework behavior
+is affected.
+
+Error Reporting
+---------------
+
+Setting the ENVIRONMENT constant to a value of 'development' will cause
+all PHP errors to be rendered to the browser when they occur.
+Conversely, setting the constant to 'production' will disable all error
+output. Disabling error reporting in production is a :doc:`good security
+practice <security>`.
+
+Configuration Files
+-------------------
+
+Optionally, you can have CodeIgniter load environment-specific
+configuration files. This may be useful for managing things like
+differing API keys across multiple environments. This is described in
+more detail in the environment section of the `Config
+Class <../libraries/config.html#environments>`_ documentation.