From ee71c80dd20bcfc60169af3eb1f628229ca30d67 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 10:05:05 -0600 Subject: added ability to enable/disable individual sections of the Profiler --- system/core/Output.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'system/core/Output.php') diff --git a/system/core/Output.php b/system/core/Output.php index ad92accd6..0dcf2e46f 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -34,6 +34,8 @@ class CI_Output { var $enable_profiler = FALSE; var $parse_exec_vars = TRUE; // whether or not to parse variables like {elapsed_time} and {memory_usage} + var $_profiler_sections = array(); + function CI_Output() { log_message('debug', "Output Class Initialized"); @@ -142,6 +144,25 @@ class CI_Output { $this->enable_profiler = (is_bool($val)) ? $val : TRUE; } + // -------------------------------------------------------------------- + + /** + * Set Profiler Sections + * + * Allows override of default / config settings for Profiler section display + * + * @access public + * @param array + * @return void + */ + function set_profiler_sections($sections) + { + foreach ($sections as $section => $enable) + { + $this->_profiler_sections[$section] = ($enable !== FALSE) ? TRUE : FALSE; + } + } + // -------------------------------------------------------------------- /** @@ -258,7 +279,12 @@ class CI_Output { if ($this->enable_profiler == TRUE) { $CI->load->library('profiler'); - + + if ( ! empty($this->_profiler_sections)) + { + $CI->profiler->set_sections($this->_profiler_sections); + } + // If the output data contains closing and tags // we will remove them and add them back after we insert the profile data if (preg_match("|.*?|is", $output)) -- cgit v1.2.3-24-g4f1b