diff options
author | Thor (atiredmachine) <thor@bandwidthbeta.com> | 2012-01-25 01:56:01 +0100 |
---|---|---|
committer | Thor (atiredmachine) <thor@bandwidthbeta.com> | 2012-01-25 01:56:01 +0100 |
commit | 63678a27864fdd6bb0ed89e6940a1d331121072a (patch) | |
tree | 81ef3b2a3fbc74f72e6b14c64caefad4be2d51f4 /system/core/Output.php | |
parent | b2c077e1e359650b444d5dc73a8fa8b94f469425 (diff) |
Rudimentary minifying of output.
Diffstat (limited to 'system/core/Output.php')
-rwxr-xr-x | system/core/Output.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/system/core/Output.php b/system/core/Output.php index 1f214a0b3..55a505c34 100755 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -323,6 +323,15 @@ class CI_Output { { $output =& $this->final_output; } + + // -------------------------------------------------------------------- + + // Is minify requested? + if ($CFG->item('minify_output') === TRUE) + { + $output = $this->minify($output); + } + // -------------------------------------------------------------------- @@ -558,6 +567,33 @@ class CI_Output { } + + + // -------------------------------------------------------------------- + /** + * Reduce excessive size of HTML content. + * + * @param string + * @param string + * @return string + */ + public function minify($output,$type='html') + { + switch ($type) + { + case 'html': + + // Replaces multiple spaces with a single space. + $output = preg_replace('!\s{2,}!',' ',$output); + + // ... + break; + } + + return $output; + } + + } /* End of file Output.php */ |