diff options
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Profiler.php | 81 |
1 files changed, 75 insertions, 6 deletions
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index ec185a1e8..ebadf8610 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -74,16 +74,16 @@ class CI_Profiler { // be modified. We also might want to make this data available to be logged $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #990000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset style="border:1px solid #900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; - $output .= '<legend style="color:#990000;"> '.$this->CI->lang->line('profiler_benchmarks').' </legend>'; + $output .= '<legend style="color:#900;"> '.$this->CI->lang->line('profiler_benchmarks').' </legend>'; $output .= "\n"; $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n"; foreach ($profile as $key => $val) { $key = ucwords(str_replace(array('_', '-'), ' ', $key)); - $output .= "<tr><td width='50%' style='color:#000;font-weight:bold;background-color:#ddd;'>".$key." </td><td width='50%' style='color:#990000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n"; + $output .= "<tr><td width='50%' style='color:#000;font-weight:bold;background-color:#ddd;'>".$key." </td><td width='50%' style='color:#900;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n"; } $output .= "</table>\n"; @@ -161,7 +161,7 @@ class CI_Profiler { $val = str_replace($bold, '<strong>'.$bold.'</strong>', $val); } - $output .= "<tr><td width='1%' valign='top' style='color:#990000;font-weight:normal;background-color:#ddd;'>".$time." </td><td style='color:#000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n"; + $output .= "<tr><td width='1%' valign='top' style='color:#900;font-weight:normal;background-color:#ddd;'>".$time." </td><td style='color:#000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n"; } } @@ -327,6 +327,7 @@ class CI_Profiler { return $output; } + // -------------------------------------------------------------------- /** @@ -351,7 +352,7 @@ class CI_Profiler { } else { - $output .= "<div style='color:#5a0099;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->lang->line('profiler_no_memory')."</div>"; + $output .= "<div style='color:#5a0099;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->lang->line('profiler_no_memory_usage')."</div>"; } $output .= "</fieldset>"; @@ -362,6 +363,73 @@ class CI_Profiler { // -------------------------------------------------------------------- /** + * Compile header information + * + * Lists HTTP headers + * + * @access public + * @return string + */ + function _compile_http_headers() + { + $output = "\n\n"; + $output .= '<fieldset style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= "\n"; + $output .= '<legend style="color:#000;"> '.$this->CI->lang->line('profiler_headers').' </legend>'; + $output .= "\n"; + + $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n"; + + foreach(array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING') as $header) + { + $val = (isset($_SERVER[$header])) ? $_SERVER[$header] : ''; + $output .= "<tr><td valign='top' style='color:#900;background-color:#ddd;'>".$header." </td><td style='color:#000;background-color:#ddd;'>".$val."</td></tr>\n"; + } + + $output .= "</table>\n"; + $output .= "</fieldset>"; + + $output .= "</fieldset>"; + + return $output; + } + + // -------------------------------------------------------------------- + + /** + * Compile config information + * + * Lists developer config variables + * + * @access public + * @return string + */ + function _compile_config() + { + $output = "\n\n"; + $output .= '<fieldset style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= "\n"; + $output .= '<legend style="color:#000;"> '.$this->CI->lang->line('profiler_config').' </legend>'; + $output .= "\n"; + + $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n"; + + foreach($this->CI->config->config as $config=>$val) + { + $output .= "<tr><td valign='top' style='color:#900;background-color:#ddd;'>".$config." </td><td style='color:#000;background-color:#ddd;'>".$val."</td></tr>\n"; + } + + $output .= "</table>\n"; + $output .= "</fieldset>"; + + $output .= "</fieldset>"; + + return $output; + } + + // -------------------------------------------------------------------- + + /** * Run the Profiler * * @access private @@ -378,7 +446,8 @@ class CI_Profiler { $output .= $this->_compile_get(); $output .= $this->_compile_post(); $output .= $this->_compile_queries(); - + $output .= $this->_compile_config(); + $output .= $this->_compile_http_headers(); $output .= '</div>'; return $output; |