Made Environment Support optional. Comment out or delete the constant to stop environment checks.
diff --git a/index.php b/index.php
index 74e3ba3..6e67c2d 100644
--- a/index.php
+++ b/index.php
@@ -28,6 +28,8 @@
  * By default development will show errors but testing and live will hide them.
  */
 
+if (defined('ENVIRONMENT'))
+{
 	switch (ENVIRONMENT)
 	{
 		case 'development':
@@ -42,6 +44,7 @@
 		default:
 			exit('The application environment is not set correctly.');
 	}
+}
 
 /*
  *---------------------------------------------------------------
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index 39a4d7f..143faec 100644
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -53,7 +53,7 @@
  *  Load the framework constants
  * ------------------------------------------------------
  */
-	if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants'.EXT))
+	if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants'.EXT))
 	{
 		require(APPPATH.'config/'.ENVIRONMENT.'/constants'.EXT);
 	}
diff --git a/system/core/Common.php b/system/core/Common.php
index f424a2c..d7054eb 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -208,19 +208,18 @@
 			return $_config[0];
 		}
 
-		$file_path = APPPATH.'config/'.ENVIRONMENT.'/config'.EXT;
+		// Is the config file in the environment folder?
+		if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config'.EXT))
+		{
+			$file_path = APPPATH.'config/config'.EXT;
+		}
 
 		// Fetch the config file
 		if ( ! file_exists($file_path))
 		{
-			$file_path = APPPATH.'config/config'.EXT;
-			
-			if ( ! file_exists($file_path))
-			{
-				exit('The configuration file does not exist.');
-			}
+			exit('The configuration file does not exist.');
 		}
-	
+
 		require($file_path);
 
 		// Does the $config array exist in the file?
diff --git a/system/core/Config.php b/system/core/Config.php
index a2a7dd5..863c5ef 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -81,29 +81,37 @@
 	function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
 	{
 		$file = ($file == '') ? 'config' : str_replace(EXT, '', $file);
+		$found = FALSE;
 		$loaded = FALSE;
 
 		foreach ($this->_config_paths as $path)
-		{			
-			$file_path = $path.'config/'.ENVIRONMENT.'/'.$file.EXT;
+		{
+			$check_locations = defined('ENVIRONMENT')
+				? array(ENVIRONMENT.'/'.$file, $file)
+				: array($file);
 
-			if (in_array($file_path, $this->is_loaded, TRUE))
+			foreach ($check_locations as $location)
 			{
-				$loaded = TRUE;
+				$file_path = $path.'config/'.$location.EXT;
+
+				if (in_array($file_path, $this->is_loaded, TRUE))
+				{
+					$loaded = TRUE;
+					continue 2;
+				}
+
+				if (file_exists($file_path))
+				{
+					$found = TRUE;
+					break;
+				}
+			}
+
+			if ($found === FALSE)
+			{
 				continue;
 			}
 
-			if ( ! file_exists($file_path))
-			{
-				log_message('debug', 'Config for '.ENVIRONMENT.' environment is not found. Trying global config.');
-				$file_path = $path.'config/'.$file.EXT;
-				
-				if ( ! file_exists($file_path))
-				{
-					continue;
-				}
-			}
-			
 			include($file_path);
 
 			if ( ! isset($config) OR ! is_array($config))
@@ -144,9 +152,9 @@
 			{
 				return FALSE;
 			}
-			show_error('The configuration file '.ENVIRONMENT.'/'.$file.EXT.' and '.$file.EXT.' do not exist.');
+			show_error('The configuration file '.$file.EXT.' does not exist.');
 		}
-		
+
 		return TRUE;
 	}
 
@@ -318,4 +326,4 @@
 // END CI_Config class
 
 /* End of file Config.php */
-/* Location: ./system/core/Config.php */
+/* Location: ./system/core/Config.php */
\ No newline at end of file
diff --git a/system/core/Hooks.php b/system/core/Hooks.php
index d1e5586..24fa105 100644
--- a/system/core/Hooks.php
+++ b/system/core/Hooks.php
@@ -65,7 +65,7 @@
 		// Grab the "hooks" definition file.
 		// If there are no hooks, we're done.
 
-		if (is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT))
+		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT))
 		{
 		    include(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT);
 		}
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 278a868..e75805d 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -872,12 +872,12 @@
 					// We test for both uppercase and lowercase, for servers that
 					// are case-sensitive with regard to file names. Check for environment
 					// first, global next
-					if (file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT))
+					if (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT))
 					{
 						include_once($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT);
 						break;
 					}
-					elseif (file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).EXT))
+					elseif (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).EXT))
 					{
 						include_once($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).EXT);
 						break;
@@ -965,7 +965,7 @@
 	 */
 	function _ci_autoloader()
 	{
-		if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT))
+		if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT))
 		{
 			include_once(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT);
 		}
diff --git a/system/core/Output.php b/system/core/Output.php
index 5ec096a..bcba257 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -42,7 +42,7 @@
 		$this->_zlib_oc = @ini_get('zlib.output_compression');
 
 		// Get mime types for later
-		if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+		if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
 		{
 		    include APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT;
 		}
diff --git a/system/core/Router.php b/system/core/Router.php
index 2c78efe..d451aab 100644
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -87,7 +87,7 @@
 		}
 
 		// Load the routes.php file.
-		if (is_file(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT))
+		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT))
 		{
 			include(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT);
 		}
diff --git a/system/database/DB.php b/system/database/DB.php
index 93ee392..8bf1ba8 100644
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -27,17 +27,12 @@
 	// Load the DB config file if a DSN string wasn't passed
 	if (is_string($params) AND strpos($params, '://') === FALSE)
 	{
-		
-		$file_path = APPPATH.'config/'.ENVIRONMENT.'/database'.EXT;
-		
-		if ( ! file_exists($file_path))
+		// Is the config file in the environment folder?
+		if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database'.EXT))
 		{
-			log_message('debug', 'Database config for '.ENVIRONMENT.' environment is not found. Trying global config.');
-			$file_path = APPPATH.'config/database'.EXT;
-			
-			if ( ! file_exists($file_path))
+			if ( ! file_exists($file_path = APPPATH.'config/database'.EXT))
 			{
-				continue;
+				show_error('The configuration file database'.EXT.' does not exist.');
 			}
 		}
 		
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index e537cde..f8073d2 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -58,7 +58,7 @@
 		$extension = end($x);
 
 		// Load the mime types
-		if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
 		{
 			include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT);
 		}
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 7a35c3f..4434494 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -352,7 +352,7 @@
 
 		if ( ! is_array($mimes))
 		{
-			if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+			if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
 			{
 				include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT);
 			}
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index 53fc899..c6103ab 100644
--- a/system/helpers/html_helper.php
+++ b/system/helpers/html_helper.php
@@ -258,7 +258,7 @@
 
 		if ( ! is_array($_doctypes))
 		{
-			if (is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT))
+			if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT))
 			{
 				include(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT);
 			}
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php
index 6c90151..a2d1031 100644
--- a/system/helpers/smiley_helper.php
+++ b/system/helpers/smiley_helper.php
@@ -229,26 +229,21 @@
 {
 	function _get_smiley_array()
 	{
-		if ( ! file_exists(APPPATH.'config/smileys'.EXT) AND ! file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT))
-		{
-			return FALSE;
-		}
-
-		if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT))
+		if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT))
 		{
 		    include(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT);
 		}
-		else
+		elseif (file_exists(APPPATH.'config/smileys'.EXT))
 		{
 			include(APPPATH.'config/smileys'.EXT);
 		}
 		
-		if ( ! isset($smileys) OR ! is_array($smileys))
+		if (isset($smileys) AND is_array($smileys))
 		{
-			return FALSE;
+			return $smileys;
 		}
 
-		return $smileys;
+		return FALSE;
 	}
 }
 
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 6644089..cca0939 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -366,7 +366,7 @@
 {
 	function convert_accented_characters($str)
 	{
-		if (is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT))
+		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT))
 		{
 			include(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT);
 		}
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 5816a55..3cd2e4f 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -951,7 +951,7 @@
 
 		if (count($this->mimes) == 0)
 		{
-			if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+			if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
 			{
 				include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT);
 			}
diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php
index 11af214..04cda73 100644
--- a/system/libraries/User_agent.php
+++ b/system/libraries/User_agent.php
@@ -84,7 +84,7 @@
 	 */
 	private function _load_agent_file()
 	{
-		if (is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT))
+		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT))
 		{
 			include(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT);
 		}
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 013c557..26e9bbc 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -68,6 +68,7 @@
 		<ul>
 			<li class="reactor"><kbd>constants.php</kbd> will now be loaded from the environment folder if available.</li>
 			<li class="reactor">Added language key error logging</li>
+			<li class="reactor">Made Environment Support optional. Comment out or delete the constant to stop environment checks.</li>
 			<li class="reactor">Added Environment Support for Hooks.</li>
 			<li class="reactor">Added CI_ Prefix to the <a href="libraries/caching.html">Cache driver</a>.</li>
 		</ul>
diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html
index dc06c87..64596e2 100644
--- a/user_guide/database/active_record.html
+++ b/user_guide/database/active_record.html
@@ -545,6 +545,30 @@
 
 <p>The first parameter will contain the table name, the second is an associative array of values.</p>
 
+<h2>$this->db->insert_batch();</h2>
+<p>Generates an insert string based on the data you supply, and runs the query. You can either pass an
+<strong>array</strong> or an <strong>object</strong> to the function.  Here is an example using an array:</p>
+
+<code>
+$data = array(<br/>
+&nbsp;&nbsp;&nbsp;array(<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => 'My title' ,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'My Name' ,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => 'My date'<br />
+&nbsp;&nbsp;&nbsp;),<br />
+&nbsp;&nbsp;&nbsp;array(<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => 'Another title' ,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'Another Name' ,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => 'Another date'<br />
+&nbsp;&nbsp;&nbsp;)<br/>
+);<br />
+<br />
+$this->db->update_batch('mytable', $data);
+<br /><br />
+// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'),  ('Another title', 'Another name', 'Another date')</code>
+
+<p>The first parameter will contain the table name, the second is an associative array of values.</p>
+
 <p class="important"><strong>Note:</strong> All values are escaped automatically producing safer queries.</p>