summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-02-02 22:19:25 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-02-02 22:19:25 +0100
commitd88b31550ae2aeb0e3bcc11ba82d4838f8a5fd31 (patch)
tree792bff97d41430b5c36a08c8ec3ac54db97375b6 /index.php
parent5c59c7dc3254616b18057922ce012f22c18b147b (diff)
parent75f5ff5d99533a423e68686d89889d172c37d98e (diff)
Merged recent changes and tweaked multi-env changes.
Diffstat (limited to 'index.php')
-rw-r--r--index.php59
1 files changed, 34 insertions, 25 deletions
diff --git a/index.php b/index.php
index 7741d5cb8..918c80259 100644
--- a/index.php
+++ b/index.php
@@ -7,12 +7,41 @@
*
* You can load different configurations depending on your
* 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".
+ * 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
*
*/
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.');
+ }
/*
*---------------------------------------------------------------
@@ -24,7 +53,7 @@
* as this file.
*
*/
- $system_path = "system";
+ $system_path = 'system';
/*
*---------------------------------------------------------------
@@ -40,7 +69,7 @@
* NO TRAILING SLASH!
*
*/
- $application_folder = "application";
+ $application_folder = 'application';
/*
* --------------------------------------------------------------------
@@ -98,26 +127,6 @@
/*
* ---------------------------------------------------------------
- * 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
- {
- error_reporting(E_ALL);
- exit("The application environment is not set correctly.");
- }
-
-/*
- * ---------------------------------------------------------------
* Resolve the system path for increased reliability
* ---------------------------------------------------------------
*/