Direct return from mimes config, instead of using global $mimes;
Global variables are generally a terrible idea, especially for something as simple as this. The mimes.php now returns an array instead of just injecting a variable name into the global namespace.
diff --git a/system/core/Output.php b/system/core/Output.php
index 9b85b3e..a9e77cc 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -106,15 +106,13 @@
 		// Get mime types for later
 		if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
 		{
-			include APPPATH.'config/'.ENVIRONMENT.'/mimes.php';
+			$this->mime_types = include APPPATH.'config/'.ENVIRONMENT.'/mimes.php';
 		}
 		else
 		{
-			include APPPATH.'config/mimes.php';
+			$this->mime_types = include APPPATH.'config/mimes.php';
 		}
 
-
-		$this->mime_types = $mimes;
 		log_message('debug', 'Output Class Initialized');
 	}
 
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index 9c390a7..3c67705 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -75,11 +75,11 @@
 			// Load the mime types
 			if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
 			{
-				include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
+				$mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
 			}
 			elseif (is_file(APPPATH.'config/mimes.php'))
 			{
-				include(APPPATH.'config/mimes.php');
+				$mimes = include(APPPATH.'config/mimes.php');
 			}
 
 			// Only change the default MIME if we can find one
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 0061c42..068706c 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -349,17 +349,17 @@
 	{
 		$extension = strtolower(substr(strrchr($file, '.'), 1));
 
-		global $mimes;
+		static $mimes;
 
 		if ( ! is_array($mimes))
 		{
 			if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
 			{
-				include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
+				$mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
 			}
 			elseif (is_file(APPPATH.'config/mimes.php'))
 			{
-				include(APPPATH.'config/mimes.php');
+				$mimes = include(APPPATH.'config/mimes.php');
 			}
 
 			if ( ! is_array($mimes))
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index bd97a61..e31029e 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -930,18 +930,16 @@
 		{
 			if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
 			{
-				include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
+				$this->mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
 			}
 			elseif (is_file(APPPATH.'config/mimes.php'))
 			{
-				include(APPPATH.'config/mimes.php');
+				$this->mimes = include(APPPATH.'config/mimes.php');
 			}
 			else
 			{
 				return FALSE;
 			}
-
-			$this->mimes = $mimes;
 		}
 
 		return isset($this->mimes[$mime]) ? $this->mimes[$mime] : FALSE;