summaryrefslogtreecommitdiffstats
path: root/system/libraries/Profiler.php
diff options
context:
space:
mode:
authorGreg Aker <greg.aker@ellislab.com>2010-11-19 01:43:03 +0100
committerGreg Aker <greg.aker@ellislab.com>2010-11-19 01:43:03 +0100
commit3a563987be22b542a26c05b21a5691c9dd4ec7be (patch)
tree5e93d057f8bbef94c6a8a0be5c4d7f21bcb460cf /system/libraries/Profiler.php
parent3080ee782b2f1c394bc6a1ba91be223f7260fda2 (diff)
Updating Output Profiler to validate xHTML Strict, and HTML5.
Diffstat (limited to 'system/libraries/Profiler.php')
-rw-r--r--system/libraries/Profiler.php49
1 files changed, 24 insertions, 25 deletions
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php
index 4441a9fbe..e7d88b665 100644
--- a/system/libraries/Profiler.php
+++ b/system/libraries/Profiler.php
@@ -117,16 +117,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 #900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
+ $output .= '<fieldset id="ci_profiler_benchmarks" style="border:1px solid #900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#900;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_benchmarks').'&nbsp;&nbsp;</legend>';
$output .= "\n";
- $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n";
+ $output .= "\n\n<table style='width:100%'>\n";
foreach ($profile as $key => $val)
{
$key = ucwords(str_replace(array('_', '-'), ' ', $key));
- $output .= "<tr><td style='width:50%;color:#000;font-weight:bold;background-color:#ddd;'>".$key."&nbsp;&nbsp;</td><td style='width:50%;color:#900;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
+ $output .= "<tr><td style='padding:5px;width:50%;color:#000;font-weight:bold;background-color:#ddd;'>".$key."&nbsp;&nbsp;</td><td style='padding:5px;width:50%;color:#900;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
}
$output .= "</table>\n";
@@ -158,12 +158,12 @@ class CI_Profiler {
if (count($dbs) == 0)
{
$output = "\n\n";
- $output .= '<fieldset style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
+ $output .= '<fieldset id="ci_profiler_queries" style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').'&nbsp;&nbsp;</legend>';
$output .= "\n";
- $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' style='width:100%'>\n";
- $output .="<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;'>".$this->CI->lang->line('profiler_no_db')."</td></tr>\n";
+ $output .= "\n\n<table style='border:none; width:100%'>\n";
+ $output .="<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px'>".$this->CI->lang->line('profiler_no_db')."</td></tr>\n";
$output .= "</table>\n";
$output .= "</fieldset>";
@@ -184,11 +184,11 @@ class CI_Profiler {
$output .= "\n";
$output .= '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database').':&nbsp; '.$db->database.'&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').': '.count($this->CI->db->queries).'&nbsp;&nbsp;&nbsp;</legend>';
$output .= "\n";
- $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' style='width:100%;'>\n";
+ $output .= "\n\n<table style='width:100%;'>\n";
if (count($db->queries) == 0)
{
- $output .= "<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;'>".$this->CI->lang->line('profiler_no_queries')."</td></tr>\n";
+ $output .= "<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px;'>".$this->CI->lang->line('profiler_no_queries')."</td></tr>\n";
}
else
{
@@ -203,7 +203,7 @@ class CI_Profiler {
$val = str_replace($bold, '<strong>'.$bold.'</strong>', $val);
}
- $output .= "<tr><td valign='top' style='width:1%;color:#900;font-weight:normal;background-color:#ddd;'>".$time."&nbsp;&nbsp;</td><td style='color:#000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
+ $output .= "<tr><td style='padding:5px; vertical-align: top;width:1%;color:#900;font-weight:normal;background-color:#ddd;'>".$time."&nbsp;&nbsp;</td><td style='padding:5px; color:#000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
}
}
@@ -226,7 +226,7 @@ class CI_Profiler {
protected function _compile_get()
{
$output = "\n\n";
- $output .= '<fieldset style="border:1px solid #cd6e00;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
+ $output .= '<fieldset id="ci_profiler_get" style="border:1px solid #cd6e00;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#cd6e00;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_get_data').'&nbsp;&nbsp;</legend>';
$output .= "\n";
@@ -237,7 +237,7 @@ class CI_Profiler {
}
else
{
- $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n";
+ $output .= "\n\n<table style='width:100%; border:none'>\n";
foreach ($_GET as $key => $val)
{
@@ -246,7 +246,7 @@ class CI_Profiler {
$key = "'".$key."'";
}
- $output .= "<tr><td width='50%' style='color:#000;background-color:#ddd;'>&#36;_GET[".$key."]&nbsp;&nbsp; </td><td width='50%' style='color:#cd6e00;font-weight:normal;background-color:#ddd;'>";
+ $output .= "<tr><td style='width:50%;color:#000;background-color:#ddd;padding:5px'>&#36;_GET[".$key."]&nbsp;&nbsp; </td><td style='width:50%;padding:5px;color:#cd6e00;font-weight:normal;background-color:#ddd;'>";
if (is_array($val))
{
$output .= "<pre>" . htmlspecialchars(stripslashes(print_r($val, true))) . "</pre>";
@@ -275,7 +275,7 @@ class CI_Profiler {
protected function _compile_post()
{
$output = "\n\n";
- $output .= '<fieldset style="border:1px solid #009900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
+ $output .= '<fieldset id="ci_profiler_post" style="border:1px solid #009900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#009900;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_post_data').'&nbsp;&nbsp;</legend>';
$output .= "\n";
@@ -286,7 +286,7 @@ class CI_Profiler {
}
else
{
- $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n";
+ $output .= "\n\n<table style='width:100%'>\n";
foreach ($_POST as $key => $val)
{
@@ -295,7 +295,7 @@ class CI_Profiler {
$key = "'".$key."'";
}
- $output .= "<tr><td width='50%' style='color:#000;background-color:#ddd;'>&#36;_POST[".$key."]&nbsp;&nbsp; </td><td width='50%' style='color:#009900;font-weight:normal;background-color:#ddd;'>";
+ $output .= "<tr><td style='width:50%;padding:5px;color:#000;background-color:#ddd;'>&#36;_POST[".$key."]&nbsp;&nbsp; </td><td style='width:50%;padding:5px;color:#009900;font-weight:normal;background-color:#ddd;'>";
if (is_array($val))
{
$output .= "<pre>" . htmlspecialchars(stripslashes(print_r($val, TRUE))) . "</pre>";
@@ -324,7 +324,7 @@ class CI_Profiler {
protected function _compile_uri_string()
{
$output = "\n\n";
- $output .= '<fieldset style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
+ $output .= '<fieldset id="ci_profiler_uri_string" 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;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_uri_string').'&nbsp;&nbsp;</legend>';
$output .= "\n";
@@ -353,14 +353,13 @@ class CI_Profiler {
protected function _compile_controller_info()
{
$output = "\n\n";
- $output .= '<fieldset style="border:1px solid #995300;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
+ $output .= '<fieldset id="ci_profiler_controller_info" style="border:1px solid #995300;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#995300;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_controller_info').'&nbsp;&nbsp;</legend>';
$output .= "\n";
$output .= "<div style='color:#995300;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->router->fetch_class()."/".$this->CI->router->fetch_method()."</div>";
-
$output .= "</fieldset>";
return $output;
@@ -378,7 +377,7 @@ class CI_Profiler {
protected function _compile_memory_usage()
{
$output = "\n\n";
- $output .= '<fieldset style="border:1px solid #5a0099;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
+ $output .= '<fieldset id="ci_profiler_memory_usage" style="border:1px solid #5a0099;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#5a0099;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_memory_usage').'&nbsp;&nbsp;</legend>';
$output .= "\n";
@@ -409,17 +408,17 @@ class CI_Profiler {
protected 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 .= '<fieldset id="ci_profiler_http_headers" 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;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_headers').'&nbsp;&nbsp;</legend>';
$output .= "\n";
- $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n";
+ $output .= "\n\n<table style='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', 'HTTP_X_FORWARDED_FOR') as $header)
{
$val = (isset($_SERVER[$header])) ? $_SERVER[$header] : '';
- $output .= "<tr><td valign='top' style='color:#900;background-color:#ddd;'>".$header."&nbsp;&nbsp;</td><td style='color:#000;background-color:#ddd;'>".$val."</td></tr>\n";
+ $output .= "<tr><td style='vertical-align: top;width:50%;padding:5px;color:#900;background-color:#ddd;'>".$header."&nbsp;&nbsp;</td><td style='width:50%;padding:5px;color:#000;background-color:#ddd;'>".$val."</td></tr>\n";
}
$output .= "</table>\n";
@@ -440,12 +439,12 @@ class CI_Profiler {
protected 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 .= '<fieldset id="ci_profiler_config" 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;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_config').'&nbsp;&nbsp;</legend>';
$output .= "\n";
- $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n";
+ $output .= "\n\n<table style='width:100%'>\n";
foreach($this->CI->config->config as $config=>$val)
{
@@ -454,7 +453,7 @@ class CI_Profiler {
$val = print_r($val, TRUE);
}
- $output .= "<tr><td valign='top' style='color:#900;background-color:#ddd;'>".$config."&nbsp;&nbsp;</td><td style='color:#000;background-color:#ddd;'>".htmlspecialchars($val)."</td></tr>\n";
+ $output .= "<tr><td style='padding:5px; vertical-align: top;color:#900;background-color:#ddd;'>".$config."&nbsp;&nbsp;</td><td style='padding:5px; color:#000;background-color:#ddd;'>".htmlspecialchars($val)."</td></tr>\n";
}
$output .= "</table>\n";