diff options
author | admin <devnull@localhost> | 2006-09-23 19:39:41 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-09-23 19:39:41 +0200 |
commit | b5a651cd710f7454425b9b94ff4a44fc4edacaba (patch) | |
tree | b5f6e42868f439eb0a05a93f041bbcca0692a5ff /system | |
parent | 4e9f3f90ed26a0dc4bcacf106d6421bf725b5ae3 (diff) |
Diffstat (limited to 'system')
-rw-r--r-- | system/codeigniter/CodeIgniter.php | 14 | ||||
-rw-r--r-- | system/libraries/Output.php | 11 |
2 files changed, 10 insertions, 15 deletions
diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index b055d3b1e..0078b4596 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -196,18 +196,10 @@ else { show_404(); } - - // Call the requested method. Any URI segments present (besides the class/function) - // will be passed to the method for convenience, either as an array or discreet params - if (isset($CI->_uri_as_array) AND $CI->_uri_as_array === TRUE) - { - $CI->$method(array_slice($RTR->rsegments, 2)); - } - else - { - call_user_func_array(array(&$CI, $method), array_slice($RTR->rsegments, 2)); - } + // Call the requested method. Any URI segments present (besides the class/function) + // will be passed to the method for convenience + call_user_func_array(array(&$CI, $method), array_slice($RTR->rsegments, 2)); } } diff --git a/system/libraries/Output.php b/system/libraries/Output.php index ec3660c6c..5a158245f 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -123,7 +123,10 @@ class CI_Output { */ function _display($output = '') { - $obj =& get_instance(); + // Note: We can't use $obj =& _get_instance() since this function + // is sometimes called by the caching mechanism, which happens before + // it's available. Instead we'll use globals... + global $BM, $CFG; if ($output == '') { @@ -138,14 +141,14 @@ class CI_Output { // Parse out the elapsed time and memory usage, and // swap the pseudo-variables with the data - $elapsed = $obj->benchmark->elapsed_time('code_igniter_start', 'code_igniter_end'); + $elapsed = $BM->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? - if ($obj->config->item('compress_output') === TRUE) + if ($CFG->item('compress_output') === TRUE) { if (extension_loaded('zlib')) { @@ -168,7 +171,7 @@ class CI_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')) + if (function_exists('_get_instance') AND method_exists($obj, '_output')) { $obj->_output($output); } |