From 6ef498b49946ba74d610b3805fb908b163a7f03a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 5 Jun 2012 22:01:58 +0300 Subject: Added get_mimes() function to system/core/Commons.php.The MIMEs array from config/mimes.php is used by multiple core classes, libraries and helpers and each of them has implemented an own way of getting it, which is not needed and is hard to maintain. This also fixes issue #1411 --- system/core/Output.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'system/core/Output.php') diff --git a/system/core/Output.php b/system/core/Output.php index a9e77cc5f..09656711b 100755 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -64,7 +64,7 @@ class CI_Output { * * @var array */ - public $mime_types = array(); + public $mimes = array(); /** * Determines wether profiler is enabled @@ -104,14 +104,7 @@ class CI_Output { $this->_zlib_oc = (bool) @ini_get('zlib.output_compression'); // Get mime types for later - if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) - { - $this->mime_types = include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; - } - else - { - $this->mime_types = include APPPATH.'config/mimes.php'; - } + $this->mimes =& get_mimes(); log_message('debug', 'Output Class Initialized'); } @@ -214,9 +207,9 @@ class CI_Output { $extension = ltrim($mime_type, '.'); // Is this extension supported? - if (isset($this->mime_types[$extension])) + if (isset($this->mimes[$extension])) { - $mime_type =& $this->mime_types[$extension]; + $mime_type =& $this->mimes[$extension]; if (is_array($mime_type)) { -- cgit v1.2.3-24-g4f1b