From c1fa07415179d63762f1a22f0f74660a8034707f Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 21 Sep 2006 23:50:23 +0000 Subject: --- system/libraries/Controller.php | 2 +- system/libraries/Output.php | 22 +++++++++++++++------- system/libraries/URI.php | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) (limited to 'system') diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 5a32e65c0..0dd6ee6a4 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -380,7 +380,7 @@ class Controller extends CI_Base { eval('class CI_DB extends CI_DB_driver { }'); } } - + require_once(BASEPATH.'drivers/DB_'.$params['dbdriver'].EXT); // Instantiate the DB adapter 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); diff --git a/system/libraries/URI.php b/system/libraries/URI.php index e831d9526..89ca42e44 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -280,7 +280,7 @@ class CI_URI { $leading = '/'; $trailing = '/'; } - return ( ! isset($this->router->$which[$n])) ? '' : $leading.$this->router->$which[$n].$trailing; + return $leading.$this->$which($n).$trailing; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b