Commits

Joël Cox  committed 354d99e

Removed default error_reporting and set it depending on environment

  • Participants
  • Parent commits a9b901c

Comments (0)

Files changed (1)

  *---------------------------------------------------------------
  *
  * 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
  *---------------------------------------------------------------
  *
 // 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