summaryrefslogtreecommitdiffstats
path: root/system/core/Output.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2010-03-10 17:05:05 +0100
committerDerek Jones <derek.jones@ellislab.com>2010-03-10 17:05:05 +0100
commitee71c80dd20bcfc60169af3eb1f628229ca30d67 (patch)
treea8cfc4369123b0227a8fc75254f88d97718aec7e /system/core/Output.php
parentcc64e97e502ce60491811b27e50b768f2517ba9b (diff)
added ability to enable/disable individual sections of the Profiler
Diffstat (limited to 'system/core/Output.php')
-rw-r--r--system/core/Output.php28
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))