diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-03-09 11:08:36 +0100 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-03-09 11:08:36 +0100 |
commit | 93ca71552d9a3e28eeaa00dd10755d20b2cbf32e (patch) | |
tree | 660233f2ec631e5730731491d2fd244fe15f7df8 /index.php | |
parent | a9924b8352aa18869677bea0182c45e2a7e2ce37 (diff) | |
parent | 2f8b27efeb0a39c24eddf89cf31ea0fd113a6b71 (diff) |
Merged recent Core changes and fixed conflict.
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 55 |
1 files changed, 45 insertions, 10 deletions
@@ -2,15 +2,46 @@ /* *--------------------------------------------------------------- - * PHP ERROR REPORTING LEVEL + * APPLICATION ENVIRONMENT *--------------------------------------------------------------- * - * 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 + * You can load different configurations depending on your + * current environment. Setting the environment also influences + * things like logging and error reporting. + * + * This can be set to anything, but default usage is: + * + * development + * testing + * production + * + * NOTE: If you change these, also change the error_reporting() code below * */ - error_reporting(E_ALL); + define('ENVIRONMENT', 'development'); +/* + *--------------------------------------------------------------- + * ERROR REPORTING + *--------------------------------------------------------------- + * + * Different environments will require different levels of error reporting. + * By default development will show errors but testing and live will hide them. + */ + + switch (ENVIRONMENT) + { + case 'development': + error_reporting(E_ALL); + break; + + case 'testing': + case 'production': + error_reporting(0); + break; + + default: + exit('The application environment is not set correctly.'); + } /* *--------------------------------------------------------------- @@ -22,7 +53,7 @@ * as this file. * */ - $system_path = "system"; + $system_path = 'system'; /* *--------------------------------------------------------------- @@ -38,7 +69,7 @@ * NO TRAILING SLASH! * */ - $application_folder = "application"; + $application_folder = 'application'; /* * -------------------------------------------------------------------- @@ -94,14 +125,18 @@ // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE // -------------------------------------------------------------------- - - - /* * --------------------------------------------------------------- * Resolve the system path for increased reliability * --------------------------------------------------------------- */ + + // Set the current directory correctly for CLI requests + if (defined('STDIN')) + { + chdir(dirname(__FILE__)); + } + if (realpath($system_path) !== FALSE) { $system_path = realpath($system_path).'/'; |