diff options
author | Derek Jones <derek.jones@ellislab.com> | 2010-03-10 17:05:05 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2010-03-10 17:05:05 +0100 |
commit | ee71c80dd20bcfc60169af3eb1f628229ca30d67 (patch) | |
tree | a8cfc4369123b0227a8fc75254f88d97718aec7e /system/core/Output.php | |
parent | cc64e97e502ce60491811b27e50b768f2517ba9b (diff) |
added ability to enable/disable individual sections of the Profiler
Diffstat (limited to 'system/core/Output.php')
-rw-r--r-- | system/core/Output.php | 28 |
1 files changed, 27 insertions, 1 deletions
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"); @@ -143,6 +145,25 @@ class CI_Output { } // -------------------------------------------------------------------- + + /** + * 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; + } + } + + // -------------------------------------------------------------------- /** * Set Cache @@ -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 </body> and </html> tags // we will remove them and add them back after we insert the profile data if (preg_match("|</body>.*?</html>|is", $output)) |