diff options
author | joelcox <joel@mickly.com> | 2011-01-16 15:24:43 +0100 |
---|---|---|
committer | joelcox <joel@mickly.com> | 2011-01-16 15:24:43 +0100 |
commit | bf2b912ec37cde3bb809437c0763bac860665915 (patch) | |
tree | ca350faeafed2385396bde631f25e42af9222d38 /index.php | |
parent | e3da4283b8b0aa96ee6f877c85c62d05dea8c778 (diff) |
Removed default error_reporting and set it depending on environment
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 38 |
1 files changed, 22 insertions, 16 deletions
@@ -6,26 +6,16 @@ *--------------------------------------------------------------- * * You can load different configurations depending on your - * current environment. The enviroment variable can be set - * to "development" (default), "test" or "production" + * current environment. Setting the environment also influences + * things like logging and error reporting. The enviroment + * variable can be set to "development" (default), + * "test" or "production". * */ define('ENVIRONMENT', 'development'); /* *--------------------------------------------------------------- - * PHP ERROR REPORTING LEVEL - *--------------------------------------------------------------- - * - * By default CI runs with error reporting set to ALL. For security - * reasons you are encouraged to change this to 0 when your site goes live. - * For more info visit: http://www.php.net/error_reporting - * - */ - error_reporting(E_ALL); - -/* - *--------------------------------------------------------------- * SYSTEM FOLDER NAME *--------------------------------------------------------------- * @@ -106,9 +96,25 @@ // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE // -------------------------------------------------------------------- +/* + * --------------------------------------------------------------- + * Check if environment is set, and set error reporting appropriately + * --------------------------------------------------------------- + */ - - + if (ENVIRONMENT == 'development') + { + error_reporting(E_ALL); + } + elseif (ENVIRONMENT == 'production' OR ENVIRONMENT == 'test') + { + error_reporting(0); + } + else + { + exit("The application environment is not set correctly."); + } + /* * --------------------------------------------------------------- * Resolve the system path for increased reliability |