summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorMelounek <petr@heralecky.cz>2012-10-05 15:50:00 +0200
committerMelounek <petr@heralecky.cz>2012-10-05 15:50:00 +0200
commitcc7c7c691ad16beb5040a8a1d07064e61b5e2167 (patch)
treef0ed98dc9f580bf38cfb13b72d8ab2cddfd69a3f /index.php
parent58dfc089bf5b0ca35c2ff244e5bfdff726f9adcd (diff)
parent6123b61e8ec95ac91f67bfbf442e34021c922319 (diff)
update devel version
Diffstat (limited to 'index.php')
-rw-r--r--index.php34
1 files changed, 18 insertions, 16 deletions
diff --git a/index.php b/index.php
index ad98013ca..107a2095b 100644
--- a/index.php
+++ b/index.php
@@ -43,6 +43,7 @@
* NOTE: If you change these, also change the error_reporting() code below
*/
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
+
/*
*---------------------------------------------------------------
* ERROR REPORTING
@@ -51,21 +52,22 @@
* Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them.
*/
-
-if (defined('ENVIRONMENT'))
+switch (ENVIRONMENT)
{
- switch (ENVIRONMENT)
- {
- case 'development':
- error_reporting(-1);
- break;
- case 'testing':
- case 'production':
- error_reporting(0);
- break;
- default:
- exit('The application environment is not set correctly.');
- }
+ case 'development':
+ error_reporting(-1);
+ ini_set('display_errors', 1);
+ break;
+
+ case 'testing':
+ case 'production':
+ error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
+ ini_set('display_errors', 0);
+ break;
+
+ default:
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
+ exit('The application environment is not set correctly.');
}
/*
@@ -133,7 +135,7 @@ if (defined('ENVIRONMENT'))
// if your controller is not in a sub-folder within the "controllers" folder
// $routing['directory'] = '';
- // The controller class file name. Example: Mycontroller
+ // The controller class file name. Example: mycontroller
// $routing['controller'] = '';
// The controller function you wish to be called.
@@ -268,4 +270,4 @@ if (defined('ENVIRONMENT'))
require_once BASEPATH.'core/CodeIgniter.php';
/* End of file index.php */
-/* Location: ./index.php */ \ No newline at end of file
+/* Location: ./index.php */