summaryrefslogtreecommitdiffstats
path: root/system/core/Output.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-05 21:01:58 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-05 21:01:58 +0200
commit6ef498b49946ba74d610b3805fb908b163a7f03a (patch)
tree7c0239269a92a6887f43cc36020258616bfec434 /system/core/Output.php
parentf4a53ce71feadb867b3ea462cb5a5b3f5052a035 (diff)
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
Diffstat (limited to 'system/core/Output.php')
-rwxr-xr-xsystem/core/Output.php15
1 files changed, 4 insertions, 11 deletions
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))
{