From 9aaa75ed7cd7b2a95cff5b8a52a59c1e6dcf9da6 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 21 Sep 2006 04:45:20 +0000 Subject: --- system/libraries/Output.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'system/libraries/Output.php') 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) { -- cgit v1.2.3-24-g4f1b