diff options
author | Derek Jones <derek.jones@ellislab.com> | 2010-03-02 20:53:25 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2010-03-02 20:53:25 +0100 |
commit | 46520494d494aa9a3579c24c0e22bfbf31aa719e (patch) | |
tree | a4acad40bcc60fabb8282b65c2c5811c894ae27d /system | |
parent | 8eae4d7a9a922763c64d282f5d46de240bba60d0 (diff) |
changed set_status_header() default $code param to proper integer
added ability to disable {elapsed_time} and {memory_usage} variables
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Output.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/system/core/Output.php b/system/core/Output.php index ea4b0e314..ad92accd6 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -32,7 +32,7 @@ class CI_Output { var $cache_expiration = 0; var $headers = array(); var $enable_profiler = FALSE; - + var $parse_exec_vars = TRUE; // whether or not to parse variables like {elapsed_time} and {memory_usage} function CI_Output() { @@ -123,7 +123,7 @@ class CI_Output { * @param string * @return void */ - function set_status_header($code = '200', $text = '') + function set_status_header($code = 200, $text = '') { set_status_header($code, $text); } @@ -199,12 +199,16 @@ class CI_Output { // Parse out the elapsed time and memory usage, // then swap the pseudo-variables with the data - - $elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end'); - $output = str_replace('{elapsed_time}', $elapsed, $output); - $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB'; - $output = str_replace('{memory_usage}', $memory, $output); + $elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end'); + + if ($this->parse_exec_vars === TRUE) + { + $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB'; + + $output = str_replace('{elapsed_time}', $elapsed, $output); + $output = str_replace('{memory_usage}', $memory, $output); + } // -------------------------------------------------------------------- |