From 242115ce9eecee4f37ec94acd8534b89a9412949 Mon Sep 17 00:00:00 2001 From: "Thor (atiredmachine)" Date: Tue, 24 Jan 2012 23:08:11 -0800 Subject: Works with set_content_type() to automatically minify for current mime type. --- system/core/Output.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/system/core/Output.php b/system/core/Output.php index c95f551ec..904e7afc7 100755 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -64,6 +64,12 @@ class CI_Output { * @var array */ protected $mime_types = array(); + /** + * Mime-type for the current page + * + * @var array + */ + protected $mime_type = NULL; /** * Determines wether profiler is enabled * @@ -216,6 +222,8 @@ class CI_Output { } } } + + $this->mime_type = $mime_type; $header = 'Content-Type: '.$mime_type; @@ -329,7 +337,7 @@ class CI_Output { // Is minify requested? if ($CFG->item('minify_output') === TRUE) { - $output = $this->minify($output); + $output = $this->minify($output,$this->mime_type); } @@ -579,6 +587,13 @@ class CI_Output { */ public function minify($output,$type='text/html') { + if($type===NULL) + { + $type = 'text/html'; + } + + die($type); + switch ($type) { case 'text/html': -- cgit v1.2.3-24-g4f1b