summaryrefslogtreecommitdiffstats
path: root/system/libraries/Output.php
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-09-22 01:50:23 +0200
committeradmin <devnull@localhost>2006-09-22 01:50:23 +0200
commitc1fa07415179d63762f1a22f0f74660a8034707f (patch)
tree8eb458e58d1c221dfa01f2adc0a97cf084bcc805 /system/libraries/Output.php
parentfc6d9079f9f47d7474c65d6bec2aa7305a35df64 (diff)
Diffstat (limited to 'system/libraries/Output.php')
-rw-r--r--system/libraries/Output.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/system/libraries/Output.php b/system/libraries/Output.php
index 4a3adb858..ec3660c6c 100644
--- a/system/libraries/Output.php
+++ b/system/libraries/Output.php
@@ -123,8 +123,8 @@ class CI_Output {
*/
function _display($output = '')
{
- $BM =& _load_class('CI_Benchmark');
-
+ $obj =& get_instance();
+
if ($output == '')
{
$output =& $this->final_output;
@@ -138,15 +138,14 @@ class CI_Output {
// Parse out the elapsed time and memory usage, and
// swap the pseudo-variables with the data
- $elapsed = $BM->elapsed_time('code_igniter_start', 'code_igniter_end');
+ $elapsed = $obj->benchmark->elapsed_time('code_igniter_start', 'code_igniter_end');
$memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
$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 ($obj->config->item('compress_output') === TRUE)
{
if (extension_loaded('zlib'))
{
@@ -166,8 +165,17 @@ class CI_Output {
}
}
- // Send it to the browser!
- echo $output;
+ // Send the finalized output either directly
+ // to the browser or to the user's _output()
+ // function if it exists
+ if (method_exists($obj, '_output'))
+ {
+ $obj->_output($output);
+ }
+ else
+ {
+ echo $output; // Send it to the browser!
+ }
log_message('debug', "Final output sent to browser");
log_message('debug', "Total execution time: ".$elapsed);