summaryrefslogtreecommitdiffstats
path: root/system/libraries/Output.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Output.php')
-rw-r--r--system/libraries/Output.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/system/libraries/Output.php b/system/libraries/Output.php
index b09bf2a53..4a3adb858 100644
--- a/system/libraries/Output.php
+++ b/system/libraries/Output.php
@@ -86,7 +86,6 @@ class CI_Output {
{
$this->headers[] = $header;
}
-
// --------------------------------------------------------------------
@@ -145,6 +144,19 @@ class CI_Output {
$output = str_replace('{memory_usage}', $memory, $output);
$output = str_replace('{elapsed_time}', $elapsed, $output);
+ // Is compression requested?
+ $CFG =& _load_class('CI_Config');
+ if ($CFG->item('compress_output') === TRUE)
+ {
+ if (extension_loaded('zlib'))
+ {
+ if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) AND strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE)
+ {
+ ob_start('ob_gzhandler');
+ }
+ }
+ }
+
// Are there any server headers to send?
if (count($this->headers) > 0)
{