1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Remove old css classes from debug info.

This commit is contained in:
Cameron
2020-12-19 10:50:08 -08:00
parent b0fc50890b
commit 4713f572d0
6 changed files with 215 additions and 186 deletions

View File

@@ -2630,15 +2630,15 @@ class error_handler
{
$text .= "
<tr>
<td class='forumheader3'>".$key."</td>
<td class='forumheader3'>";
<td>".$key."</td>
<td>";
$text .= !empty($val['class']) ? $val['class']."->" : '';
$text .= !empty($val['include_filename']) ? "include: ". str_replace($this->docroot,'', $val['include_filename']) : '';
$text .= !empty($val['function']) ? $val['function']."(" : "";
$text .= !empty($val['params']) ? print_r($val['params'],true) : '';
$text .= !empty($val['function']) ? ")" : "";
$text .="</td>
<td class='forumheader3'>";
<td>";
$text .= str_replace($this->docroot,'', $val['file']).":".$val['line'];
$text .= "</td>
</tr>";
@@ -2664,7 +2664,7 @@ class error_handler
foreach ($this->errors as $key => $value)
{
$ret .= "\t<tr>\n\t\t<td class='forumheader3' >{$value['short']}</td><td><input class='btn btn-info button e-expandit' data-target = 'bt_{$key}' type ='button' style='cursor: hand; cursor: pointer;' size='30' value='Back Trace' />\n";
$ret .= "\t<tr>\n\t\t<td>{$value['short']}</td><td><input class='btn btn-info button e-expandit' data-target = 'bt_{$key}' type ='button' style='cursor: hand; cursor: pointer;' size='30' value='Back Trace' />\n";
$ret .= "</td>\n\t</tr>";
$ret .= "\t<tr>\n<td style='display: none;' colspan='2' id='bt_{$key}'>".$this->render_trace($value['trace'])."</td></tr>\n";
@@ -2676,11 +2676,11 @@ class error_handler
{
foreach ($this->errors as $key => $value)
{
$ret .= "<tr><td class='forumheader3'>{$value['short']}</td></tr>\n";
$ret .= "<tr><td>{$value['short']}</td></tr>\n";
}
}
return ($ret) ? "<table class='table table-condensed fborder'>\n".$ret."</table>" : FALSE;
return ($ret) ? "<table class='table table-condensed'>\n".$ret."</table>" : FALSE;
}
/**

View File

@@ -195,18 +195,18 @@ if ((ADMIN || $pref['developer']) && E107_DEBUG_LEVEL)
usage: add ?showsql to query string, must be admin
*/
// XXX - Too old? Something using this?
// XXX Part of DEBUG info
if (ADMIN && isset($queryinfo) && is_array($queryinfo))
{
$c = 1;
$mySQLInfo = $sql->mySQLinfo;
echo "<div class='e-debug query-notice'>
<table class='fborder table table-bordered table-striped' style='width: 100%;'>
<table class='table table-bordered table-striped' style='width: 100%;'>
<tr>
<th class='fcaption' style='width: 5%;'>ID</th><th class='fcaption' style='width: 95%;'>SQL Queries</th>\n</tr>\n";
<th style='width: 5%;'>ID</th><th class='fcaption' style='width: 95%;'>SQL Queries</th>\n</tr>\n";
foreach ($queryinfo as $infovalue)
{
echo "<tr>\n<td class='forumheader3' style='width: 5%;'>{$c}</td><td class='forumheader3' style='width: 95%;'>{$infovalue}</td>\n</tr>\n";
echo "<tr>\n<td style='width: 5%;'>{$c}</td><td style='width: 95%;'>{$infovalue}</td>\n</tr>\n";
$c++;
}
echo "</table></div>";

View File

@@ -203,12 +203,15 @@ if (ADMIN && isset($queryinfo) && is_array($queryinfo))
{
$c = 1;
$mySQLInfo = $sql->mySQLinfo;
echo "<div class='e-debug query-notice'><table class='fborder table table-striped table-bordered' style='width: 100%;'>
echo "<div class='e-debug query-notice'>
<h4>SQL</h4>
<table class='table table-striped table-bordered' style='width: 100%;'>
<tr>
<th class='fcaption' style='width: 5%;'>ID</th><th class='fcaption' style='width: 95%;'>SQL Queries</th>\n</tr>\n";
<th style='width: 5%;'>ID</th><th style='width: 95%;'>SQL Queries</th>\n</tr>\n";
foreach ($queryinfo as $infovalue)
{
echo "<tr>\n<td class='forumheader3' style='width: 5%;'>{$c}</td><td class='forumheader3' style='width: 95%;'>{$infovalue}</td>\n</tr>\n";
echo "<tr>\n<td style='width: 5%;'>{$c}</td>
<td style='width: 95%;'>{$infovalue}</td>\n</tr>\n";
$c++;
}
echo "</table></div>";

View File

@@ -251,9 +251,9 @@
if(!$bRowHeaders)
{
$bRowHeaders = true;
$t['explain'] = "<tr><td class='forumheader3'><b>" . implode("</b></td><td class='forumheader3'><b>", array_keys($row)) . "</b></td></tr>\n";
$t['explain'] = "<tr><td><b>" . implode("</b></td><td><b>", array_keys($row)) . "</b></td></tr>\n";
}
$t['explain'] .= "<tr><td class='forumheader3'>" . implode("&nbsp;</td><td class='forumheader3'>", array_values($row)) . "&nbsp;</td></tr>\n";
$t['explain'] .= "<tr><td>" . implode("&nbsp;</td><td>", array_values($row)) . "&nbsp;</td></tr>\n";
}
}
else
@@ -323,16 +323,16 @@
if($badCount)
{
$text .= "\n<table class='fborder table table-striped table-bordered'>\n";
$text .= "<tr><td class='fcaption' colspan='2'><b>$badCount Query Errors!</b></td></tr>\n";
$text .= "<tr><td class='fcaption'><b>Index</b></td><td class='fcaption'><b>Query / Error</b></td></tr>\n";
$text .= "\n<table class='table table-striped table-bordered'>\n";
$text .= "<tr><th colspan='2'><b>$badCount Query Errors!</b></td></tr>\n";
$text .= "<tr><th><b>Index</b></td><th><b>Query / Error</b></td></tr>\n";
foreach($this->aSQLdetails as $idx => $cQuery)
{
if(!$cQuery['ok'])
{
$text .= "<tr><td class='forumheader3' rowspan='2' style='text-align:right'>{$idx}&nbsp;</td>
<td class='forumheader3'>" . $cQuery['query'] . "</td></tr>\n<tr><td class='forumheader3'>" . $cQuery['error'] . "</td></tr>\n";
$text .= "<tr><td rowspan='2' style='text-align:right'>{$idx}&nbsp;</td>
<td>" . $cQuery['query'] . "</td></tr>\n<tr><td>" . $cQuery['error'] . "</td></tr>\n";
}
}
$text .= "\n</table><br />\n";
@@ -344,10 +344,10 @@
if($okCount && E107_DBG_SQLDETAILS)
{
$text .= "\n<table class='fborder table table-striped table-bordered'>\n";
$text .= "<tr><td class='fcaption' colspan='3'><b>" . $this->countLabel($okCount) . " Good Queries</b></td></tr>\n";
$text .= "<tr><td class='fcaption'><b>Index</b></td><td class='fcaption'><b>Qtime</b></td><td class='fcaption'><b>Query</b></td></tr>\n
<tr><td class='fcaption'>&nbsp;</td><td class='fcaption'><b>(msec)</b></td><td class='fcaption'>&nbsp;</td></tr>\n
$text .= "\n<table class='table table-striped table-bordered'>\n";
$text .= "<tr><th colspan='3'><b>" . $this->countLabel($okCount) . " Good Queries</b></td></tr>\n";
$text .= "<tr><th><b>Index</b></td><th><b>Qtime</b></td><th><b>Query</b></td></tr>\n
<tr><th>&nbsp;</td><th><b>(msec)</b></td><th>&nbsp;</td></tr>\n
";
$count = 0;
@@ -362,9 +362,9 @@
if($cQuery['ok'])
{
$text .= "<tr><td class='forumheader3' style='text-align:right'>{$idx}&nbsp;</td>
<td class='forumheader3' style='text-align:right'>" . number_format($cQuery['time'] * 1000.0, 4) . "&nbsp;</td>
<td class='forumheader3'>" . $cQuery['query'] . '<br />[' . $cQuery['marker'] . " - " . $cQuery['caller'] . "]</td></tr>\n";
$text .= "<tr><td style='text-align:right'>{$idx}&nbsp;</td>
<td style='text-align:right'>" . number_format($cQuery['time'] * 1000.0, 4) . "&nbsp;</td>
<td>" . $cQuery['query'] . '<br />[' . $cQuery['marker'] . " - " . $cQuery['caller'] . "]</td></tr>\n";
$count++;
}
@@ -383,18 +383,18 @@
$count = 0;
foreach($this->aSQLdetails as $idx => $cQuery)
{
$text .= "\n<table class='fborder table table-striped table-bordered' style='width: 100%;'>\n";
$text .= "<tr><td class='forumheader3' colspan='" . $cQuery['nFields'] . "'><b>" . $idx . ") Query:</b> [" . $cQuery['marker'] . " - " . $cQuery['caller'] . "]<br />" . $cQuery['query'] . "</td></tr>\n";
$text .= "\n<table class='table table-striped table-bordered' style='width: 100%;'>\n";
$text .= "<tr><td colspan='" . $cQuery['nFields'] . "'><b>" . $idx . ") Query:</b> [" . $cQuery['marker'] . " - " . $cQuery['caller'] . "]<br />" . $cQuery['query'] . "</td></tr>\n";
if(isset($cQuery['explain']))
{
$text .= $cQuery['explain'];
}
if(strlen($cQuery['error']))
{
$text .= "<tr><td class='forumheader3' ><b>Error in query:</b></td></tr>\n<tr><td class='forumheader3'>" . $cQuery['error'] . "</td></tr>\n";
$text .= "<tr><td ><b>Error in query:</b></td></tr>\n<tr><td>" . $cQuery['error'] . "</td></tr>\n";
}
$text .= "<tr><td class='forumheader3' colspan='" . $cQuery['nFields'] . "'><b>Query time:</b> " . number_format($cQuery['time'] * 1000.0, 4) . ' (ms)</td></tr>';
$text .= "<tr><td colspan='" . $cQuery['nFields'] . "'><b>Query time:</b> " . number_format($cQuery['time'] * 1000.0, 4) . ' (ms)</td></tr>';
$text .= '</table><br />' . "\n";
@@ -485,7 +485,7 @@
$totTime = e107::getSingleton('e107_traffic')->TimeDelta($eTimingStart, $eTimingStop);
$text = "\n<table class='fborder table table-striped table-condensed'>\n";
$text = "\n<table class='table table-striped table-condensed'>\n";
$bRowHeaders = false;
reset($this->aTimeMarks);
$aSum = $this->aTimeMarks[0]; // create a template from the 'real' array
@@ -529,7 +529,7 @@
{
// First time: emit headers
$bRowHeaders = true;
$text .= "<tr><td class='fcaption' style='text-align:right'><b>" . implode("</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>", array_keys($tMarker)) . "</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>OB Lev&nbsp;</b></td></tr>\n";
$text .= "<tr><th style='text-align:right'><b>" . implode("</b>&nbsp;</td><th style='text-align:right'><b>", array_keys($tMarker)) . "</b>&nbsp;</td><th style='text-align:right'><b>OB Lev&nbsp;</b></td></tr>\n";
$aUnits = $tMarker;
foreach($aUnits as $key => $val)
{
@@ -547,7 +547,7 @@
$aUnits['OB Lev'] = 'lev(buf bytes)';
$aUnits['Memory'] = '(kb)';
$aUnits['Memory Used'] = '(kb)';
$text .= "<tr><td class='fcaption' style='text-align:right'><b>" . implode("</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>", $aUnits) . "</b>&nbsp;</td></tr>\n";
$text .= "<tr><th style='text-align:right'><b>" . implode("</b>&nbsp;</td><th style='text-align:right'><b>", $aUnits) . "</b>&nbsp;</td></tr>\n";
}
@@ -614,11 +614,11 @@
$tMarker['OB Lev'] = $this->aOBMarks[$tKey];
}
$text .= "<tr><td class='forumheader3' >" . implode("&nbsp;</td><td class='forumheader3' style='text-align:right'>", array_values($tMarker)) . "&nbsp;</td></tr>\n";
$text .= "<tr><td >" . implode("&nbsp;</td><td style='text-align:right'>", array_values($tMarker)) . "&nbsp;</td></tr>\n";
if(isset($this->aMarkNotes[$tKey]))
{
$text .= "<tr><td class='forumheader3' >&nbsp;</td><td class='forumheader3' colspan='4'>";
$text .= "<tr><td >&nbsp;</td><td colspan='4'>";
$text .= $this->aMarkNotes[$tKey] . "</td></tr>\n";
}
@@ -636,24 +636,24 @@
$text .= "<tr>
<td class='fcaption'>&nbsp;</td>
<td class='fcaption' style='text-align:right'><b>Total</b></td>
<td class='fcaption' style='text-align:right'><b>" . $aSum['%Time'] . "</b></td>
<td class='fcaption' style='text-align:right'><b>" . $aSum['%DB Time'] . "</b></td>
<td class='fcaption' style='text-align:right'><b>" . $aSum['%DB Count'] . "</b></td>
<td class='fcaption' style='text-align:right' title='Time (msec)'><b>" . $aSum['Time'] . "</b></td>
<td class='fcaption' style='text-align:right' title='DB Time (msec)'><b>" . $aSum['DB Time'] . "</b></td>
<td class='fcaption' style='text-align:right'><b>" . $aSum['DB Count'] . "</b></td>
<td class='fcaption' style='text-align:right' title='Memory (Kb)'><b>" . number_format($aSum['Memory'] / 1024, 1) . "</b></td>
<td class='fcaption' style='text-align:right' title='Memory (Kb)'><b>" . number_format($aSum['Memory'] / 1024, 1) . "</b></td>
<th>&nbsp;</td>
<th style='text-align:right'><b>Total</b></td>
<th style='text-align:right'><b>" . $aSum['%Time'] . "</b></td>
<th style='text-align:right'><b>" . $aSum['%DB Time'] . "</b></td>
<th style='text-align:right'><b>" . $aSum['%DB Count'] . "</b></td>
<th style='text-align:right' title='Time (msec)'><b>" . $aSum['Time'] . "</b></td>
<th style='text-align:right' title='DB Time (msec)'><b>" . $aSum['DB Time'] . "</b></td>
<th style='text-align:right'><b>" . $aSum['DB Count'] . "</b></td>
<th style='text-align:right' title='Memory (Kb)'><b>" . number_format($aSum['Memory'] / 1024, 1) . "</b></td>
<th style='text-align:right' title='Memory (Kb)'><b>" . number_format($aSum['Memory'] / 1024, 1) . "</b></td>
<td class='fcaption' style='text-align:right'><b>" . $tMarker['OB Lev'] . "</b></td>
<th style='text-align:right'><b>" . $tMarker['OB Lev'] . "</b></td>
</tr>
";
// $text .= "<tr><td class='fcaption'><b>".implode("</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>", $aSum)."</b>&nbsp;</td><td class='fcaption'>&nbsp;</td></tr>\n";
// $text .= "<tr><th><b>".implode("</b>&nbsp;</td><th style='text-align:right'><b>", $aSum)."</b>&nbsp;</td><th>&nbsp;</td></tr>\n";
$text .= "\n</table><br />\n";
@@ -662,7 +662,7 @@
// Stats by Table
//
$text .= "\n<table class='fborder table table-striped table-condensed'>
$text .= "\n<table class='table table-striped table-condensed'>
<colgroup>
<col style='width:auto' />
<col style='width:9%' />
@@ -684,7 +684,7 @@
if(!$bRowHeaders)
{
$bRowHeaders = true;
$text .= "<tr><td class='fcaption'><b>" . implode("</b></td><td class='fcaption' style='text-align:right'><b>", array_keys($curTable)) . "</b></td></tr>\n";
$text .= "<tr><th><b>" . implode("</b></td><th style='text-align:right'><b>", array_keys($curTable)) . "</b></td></tr>\n";
$aUnits = $curTable;
foreach($aUnits as $key => $val)
{
@@ -698,7 +698,7 @@
break;
}
}
$text .= "<tr><td class='fcaption' style='text-align:right'><b>" . implode("</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>", $aUnits) . "</b>&nbsp;</td></tr>\n";
$text .= "<tr><th style='text-align:right'><b>" . implode("</b>&nbsp;</td><th style='text-align:right'><b>", $aUnits) . "</b>&nbsp;</td></tr>\n";
}
$aSum['DB Time'] += $curTable['DB Time'];
@@ -708,13 +708,13 @@
$timeLabel = number_format($curTable['DB Time'] * 1000.0, 1);
$curTable['DB Time'] = $this->highlight($timeLabel, ($curTable['DB Time'] * 1000), 500); // 500 msec
$text .= "<tr><td class='forumheader3'>" . implode("&nbsp;</td><td class='forumheader3' style='text-align:right'>", array_values($curTable)) . "&nbsp;</td></tr>\n";
$text .= "<tr><td>" . implode("&nbsp;</td><td style='text-align:right'>", array_values($curTable)) . "&nbsp;</td></tr>\n";
}
$aSum['%DB Time'] = $db_time ? number_format(100.0 * ($aSum['DB Time'] / $db_time), 0) : 0;
$aSum['%DB Count'] = ($sql->db_QueryCount()) ? number_format(100.0 * ($aSum['DB Count'] / ($sql->db_QueryCount())), 0) : 0;
$aSum['DB Time'] = number_format($aSum['DB Time'] * 1000.0, 1);
$text .= "<tr><td class='fcaption'><b>" . implode("&nbsp;</td><td class='fcaption' style='text-align:right'><b>", array_values($aSum)) . "&nbsp;</b></td></tr>\n";
$text .= "<tr><th><b>" . implode("&nbsp;</td><th style='text-align:right'><b>", array_values($aSum)) . "&nbsp;</b></td></tr>\n";
$text .= "\n</table><br />\n";
return $text;
@@ -760,14 +760,14 @@
return false;
}
$text = "<table class='fborder table table-striped table-condensed' style='width: 100%'>
$text = "<table class='table table-striped table-condensed' style='width: 100%'>
<thead>
<tr>
<th class='fcaption' style='width: 10%;'>Type</th>
<th class='fcaption' style='width: 30%;'>Code</th>
<th class='fcaption' style='width: 20%;'>Parm</th>
<th class='fcaption' style='width: 40%;'>Details</th>
<th style='width: 10%;'>Type</th>
<th style='width: 30%;'>Code</th>
<th style='width: 20%;'>Parm</th>
<th style='width: 40%;'>Details</th>
</tr>
</thead>
<tbody>\n";
@@ -781,10 +781,10 @@
$type = $codes['type'];
$text .= "<tr>
<td class='forumheader3' style='width: 10%;'><span class='label " . $style[$type] . "'>" . ($description[$type]) . "</span></td>
<td class='forumheader3' style='width: auto;'>" . (isset($codes['code']) ? $codes['code'] : "&nbsp;") . "</td>
<td class='forumheader3' style='width: auto;'>" . ($codes['parm'] ? $codes['parm'] : "&nbsp;") . "</td>
<td class='forumheader3' style='width: 40%;'>" . ($codes['details'] ? $codes['details'] : "&nbsp;") . "</td>
<td style='width: 10%;'><span class='label " . $style[$type] . "'>" . ($description[$type]) . "</span></td>
<td style='width: auto;'>" . (isset($codes['code']) ? $codes['code'] : "&nbsp;") . "</td>
<td style='width: auto;'>" . ($codes['parm'] ? $codes['parm'] : "&nbsp;") . "</td>
<td style='width: 40%;'>" . ($codes['details'] ? $codes['details'] : "&nbsp;") . "</td>
</tr>\n";
}
$text .= "</tbody></table>";
@@ -803,14 +803,14 @@
global $e107;
$sql = e107::getDb();
$text = "<table class='fborder table table-striped table-condensed debug-footer' style='width:100%'>
$text = "<table class='table table-striped table-condensed debug-footer' style='width:100%'>
<colgroup>
<col style='width:20%' />
<col style='width:auto' />
</colgroup>
<thead>
<tr>
<th class='fcaption debug-footer-caption left' colspan='2'><b>Paths &amp; Variables</b></th>
<th class='debug-footer-caption left' colspan='2'><b>Paths &amp; Variables</b></th>
</tr>
</thead>
<tbody>\n";
@@ -831,8 +831,8 @@
{
$text .= "
<tr>
<td class='forumheader3'>" . $k . "</td>
<td class='forumheader3'>" . htmlspecialchars($v) . "</td>
<td>" . $k . "</td>
<td>" . htmlspecialchars($v) . "</td>
</tr>";
}
}
@@ -843,39 +843,39 @@
<tr>
<td class='forumheader3'>SQL Language</td>
<td class='forumheader3'>" . $sql->mySQLlanguage . "</td>
<td>SQL Language</td>
<td>" . $sql->mySQLlanguage . "</td>
</tr>
";
if($_SERVER['E_DEV'] == 'true')
{
$text .= "
<tr>
<td class='forumheader3' colspan='2'><pre>" . htmlspecialchars(print_r($e107, true)) . "</pre></td>
<td colspan='2'><pre>" . htmlspecialchars(print_r($e107, true)) . "</pre></td>
</tr>";
}
$text .= "
<tr>
<td class='fcaption' colspan='2'><h2>Session</h2></td>
<th colspan='2'><h2>Session</h2></td>
</tr>
<tr>
<td class='forumheader3'>Session lifetime</td>
<td class='forumheader3'>" . $sess->getOption('lifetime') . " seconds</td>
<td>Session lifetime</td>
<td>" . $sess->getOption('lifetime') . " seconds</td>
</tr>
<tr>
<td class='forumheader3'>Session domain</td>
<td class='forumheader3'>" . $sess->getOption('domain') . "</td>
<td>Session domain</td>
<td>" . $sess->getOption('domain') . "</td>
</tr>
<tr>
<td class='forumheader3'>Session save method</td>
<td class='forumheader3'>" . $sess->getSaveMethod() . "</td>
<td>Session save method</td>
<td>" . $sess->getSaveMethod() . "</td>
</tr>
<tr>
<td class='forumheader3' colspan='2'><pre>" . htmlspecialchars(print_r($_SESSION, true)) . "</pre></td>
<td colspan='2'><pre>" . htmlspecialchars(print_r($_SESSION, true)) . "</pre></td>
</tr>
</tbody>
@@ -894,13 +894,13 @@
}
else
{
$text = "<table class='fborder table table-striped table-condensed' style='width: 100%'>
<tr><td class='fcaption' colspan='4'><b>The following deprecated functions were used:</b></td></tr>
$text = "<table class='table table-striped table-condensed' style='width: 100%'>
<tr><th colspan='4'><b>The following deprecated functions were used:</b></td></tr>
<thead>
<tr>
<th class='fcaption' style='width: 10%;'>Function</th>
<th class='fcaption' style='width: 10%;'>File</th>
<th class='fcaption' style='width: 10%;'>Line</th>
<th style='width: 10%;'>Function</th>
<th style='width: 10%;'>File</th>
<th style='width: 10%;'>Line</th>
</tr>
</thead>
<tbody>\n";
@@ -908,9 +908,9 @@
foreach($this->deprecated_funcs as $funcs)
{
$text .= "<tr>
<td class='forumheader3' style='width: 10%;'>{$funcs['func']}()</td>
<td class='forumheader3' style='width: 10%;'>{$funcs['file']}</td>
<td class='forumheader3' style='width: 10%;'>{$funcs['line']}</td>
<td style='width: 10%;'>{$funcs['func']}()</td>
<td style='width: 10%;'>{$funcs['file']}</td>
<td style='width: 10%;'>{$funcs['line']}</td>
</tr>\n";
}
$text .= "</tbody></table>";
@@ -1009,7 +1009,7 @@
// Dump the debug log
//
$text = "\n<table class='fborder table table-striped'>\n";
$text = "\n<table class='table table-striped'>\n";
$bRowHeaders = false;
@@ -1018,10 +1018,10 @@
if(!$bRowHeaders)
{
$bRowHeaders = true;
$text .= "<tr><td class='fcaption' style='text-align:left'><b>" . implode("</b></td><td class='fcaption' style='text-align:left'><b>", array_keys($curLog)) . "</b></td></tr>\n";
$text .= "<tr><th style='text-align:left'><b>" . implode("</b></td><th style='text-align:left'><b>", array_keys($curLog)) . "</b></td></tr>\n";
}
$text .= "<tr ><td class='forumheader3'>" . implode("&nbsp;</td><td class='forumheader3'>", array_values($curLog)) . "&nbsp;</td></tr>\n";
$text .= "<tr ><td>" . implode("&nbsp;</td><td>", array_values($curLog)) . "&nbsp;</td></tr>\n";
}
$text .= "</table><br />\n";
@@ -1038,9 +1038,9 @@
}
$text = "<table class='fborder table table-striped'>\n";
$text .= "<tr><td class='forumheader3'>" .
implode("&nbsp;</td></tr>\n<tr><td class='forumheader3'>", $this->aIncList) .
$text = "<table class='table table-striped'>\n";
$text .= "<tr><td>" .
implode("&nbsp;</td></tr>\n<tr><td>", $this->aIncList) .
"&nbsp;</td></tr>\n";
$text .= "</table>\n";

View File

@@ -14,7 +14,10 @@
* $Author$
*/
if (!defined('e107_INIT')) { exit; }
if (!defined('e107_INIT'))
{
exit;
}
//
// This is the content-code for e107_traffic::Display()
@@ -23,105 +26,125 @@ if (!defined('e107_INIT')) { exit; }
// See traffic_class.php
//
if (count($this->aTraffic)) { // Simple counts
$text .= "\n<table class='fborder table table-condensed table-striped'>\n";
$text .= "<thead>
if (count($this->aTraffic))
{ // Simple counts
$text .= "\n<table class='table table-condensed table-striped'>\n";
$text .= "<thead>
<tr>
<th class='fcaption' style='width:15%'>Item</th>
<th class='fcaption' style='text-align:right;width:15%'>Count&nbsp;</th>
<th class='fcaption'>&nbsp;</th>
<th style='width:15%'>Item</th>
<th style='text-align:right;width:15%'>Count&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>\n";
foreach ($this->aTraffic as $key=>$aVals) {
$text .= "<tr>
<td class='forumheader3'>".
$key."</td>
<td class='forumheader3' style='text-align:right;width:20%'>".
$aVals['Count']."&nbsp;</td><td class='forumheader3'>&nbsp;</td></tr>\n";
if (isset($this->aTrafficWho[$key])) {
$text .= "<tr><td class='forumheader3' valign='top'>Callers:</td>
<td class='forumheader3' colspan='2'>";
$bFirst=TRUE;
foreach ($this->aTrafficWho[$key] as $sWho) {
if ($bFirst ) {
$bFirst = FALSE;
} else {
$text .= "<br />\n";
}
$text .= $sWho;
}
$text .= "</td></tr>\n";
}
}
$text .="</table><br />\n";
}
//
// Fancy timed counts
//
if (count($this->aTrafficTimed)) {
$text .= "\n<table class='fborder table table-condensed table-striped'>\n";
$text .= "
foreach ($this->aTraffic as $key => $aVals)
{
$text .= "<tr>
<td>" .
$key . "</td>
<td style='text-align:right;width:20%'>" .
$aVals['Count'] . "&nbsp;</td><td>&nbsp;</td></tr>\n";
if (isset($this->aTrafficWho[$key]))
{
$text .= "<tr><td valign='top'>Callers:</td>
<td colspan='2'>";
$bFirst = true;
foreach ($this->aTrafficWho[$key] as $sWho)
{
if ($bFirst)
{
$bFirst = false;
}
else
{
$text .= "<br />\n";
}
$text .= $sWho;
}
$text .= "</td></tr>\n";
}
}
$text .= "</table><br />\n";
}
//
// Fancy timed counts
//
if (count($this->aTrafficTimed))
{
$text .= "\n<table class='fborder table table-condensed table-striped'>\n";
$text .= "
<thead>
<tr>
<th class='fcaption'>Item</th>
<th class='fcaption'>Count&nbsp;</th>
<th class='fcaption'>Tot Time (ms)&nbsp;</th>
<th class='fcaption'>Avg Time (us)&nbsp;</th>
<th class='fcaption'>Min Time (us)&nbsp;</th>
<th class='fcaption'>Max Time (us)&nbsp;</th>
<th>Item</th>
<th>Count&nbsp;</th>
<th>Tot Time (ms)&nbsp;</th>
<th>Avg Time (us)&nbsp;</th>
<th>Min Time (us)&nbsp;</th>
<th>Max Time (us)&nbsp;</th>
</tr>
</thead>\n";
foreach ($this->aTrafficTimed as $key=>$aVals) {
if (substr($key,0,8)=='TRAF_CAL') continue;
$text .= "<tr>
<td class='forumheader3'>".
$key."</td>
<td class='forumheader3' style='text-align:right'>".
$aVals['Count']."&nbsp;</td>";
if ($aVals['Count'] && isset($aVals['Time']) && $aVals['Time']) {
$sTot = number_format($aVals['Time']*1000.0,4);
$sAvg = number_format($aVals['Time']*1000000.0/$aVals['Count'],1);
$sMin = number_format($aVals['Min']*1000000.0,1);
$sMax = number_format($aVals['Max']*1000000.0,1);
} else {
$sTot = $sAvg = $sMin = $sMax = '';
}
$text .= "<td class='forumheader3' style='text-align:right'>".
$sTot."&nbsp;</td>
<td class='forumheader3' style='text-align:right'>".
$sAvg."&nbsp;</td>
<td class='forumheader3' style='text-align:right'>".
$sMin."&nbsp;</td>
<td class='forumheader3' style='text-align:right'>".
$sMax."&nbsp;</td>
</tr>\n";
if (isset($this->aTrafficWho[$key])) {
$text .= "<tr><td class='forumheader3' valign='top'>Callers:</td>
<td class='forumheader3' colspan='5'>";
$bFirst=TRUE;
foreach ($this->aTrafficWho[$key] as $sWho) {
if ($bFirst ) {
$bFirst = FALSE;
} else {
$text .= "<br />\n";
}
$text .= $sWho;
}
$text .= "</td></tr>\n";
}
}
$cal1 = number_format($this->calPassOne*1000000.0,1);
$cal2 = number_format($this->calPassBoth*1000000.0,1);
$cTot = number_format($this->calTime*1000.0,4);
$text .="<tr><td class='forumheader3' colspan='6'>
foreach ($this->aTrafficTimed as $key => $aVals)
{
if (substr($key, 0, 8) == 'TRAF_CAL')
{
continue;
}
$text .= "<tr>
<td>" .
$key . "</td>
<td style='text-align:right'>" .
$aVals['Count'] . "&nbsp;</td>";
if ($aVals['Count'] && isset($aVals['Time']) && $aVals['Time'])
{
$sTot = number_format($aVals['Time'] * 1000.0, 4);
$sAvg = number_format($aVals['Time'] * 1000000.0 / $aVals['Count'], 1);
$sMin = number_format($aVals['Min'] * 1000000.0, 1);
$sMax = number_format($aVals['Max'] * 1000000.0, 1);
}
else
{
$sTot = $sAvg = $sMin = $sMax = '';
}
$text .= "<td style='text-align:right'>" .
$sTot . "&nbsp;</td>
<td style='text-align:right'>" .
$sAvg . "&nbsp;</td>
<td style='text-align:right'>" .
$sMin . "&nbsp;</td>
<td style='text-align:right'>" .
$sMax . "&nbsp;</td>
</tr>\n";
if (isset($this->aTrafficWho[$key]))
{
$text .= "<tr><td valign='top'>Callers:</td>
<td colspan='5'>";
$bFirst = true;
foreach ($this->aTrafficWho[$key] as $sWho)
{
if ($bFirst)
{
$bFirst = false;
}
else
{
$text .= "<br />\n";
}
$text .= $sWho;
}
$text .= "</td></tr>\n";
}
}
$cal1 = number_format($this->calPassOne * 1000000.0, 1);
$cal2 = number_format($this->calPassBoth * 1000000.0, 1);
$cTot = number_format($this->calTime * 1000.0, 4);
$text .= "<tr><td colspan='6'>
<b>Note:</b> These times have been decreased by the calibration offset:<br />
$cal2 usec per call(start,stop); $cal1 usec per call(start). Total adjustment: $cTot msec.</td></tr>\n";
$text .="</table><br />\n";
}
$text .= "</table><br />\n";
}

View File

@@ -395,8 +395,11 @@ div.e-debug .table { background-color: rgb(46, 51, 56); border-coll
div.e-debug .table-striped > tbody > tr:nth-of-type(2n+1) { background-color: #353a41; }
div.e-debug td, div.e-debug th { padding: 5px; }
div.e-debug td { color: rgb(200, 200, 200); line-height: 1.42857143; vertical-align: top; border-top: 1px solid #1c1e22; }
div.e-debug td { font-size: 14px; line-height: 20px; color: rgb(200, 200, 200); line-height: 1.42857143; vertical-align: top; border-top: 1px solid #1c1e22; }
div.e-debug h4 { text-shadow: -1px -1px 0 rgba(0,0,0,0.3); font-size: 18px; }
div.e-debug .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: 700; line-height: 1;
color: #ffffff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; }
div.e-debug .label-danger { background-color: #ee5f5b; }
div.e-debug .label-danger { background-color: #ee5f5b; }
div.e-debug .btn { display: inline-block; margin-bottom: 0; font-weight: 400; text-align: center; vertical-align: middle;
cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap;
padding: 8px 12px; font-size: 14px; line-height: 1.42857143; border-radius: 4px; user-select: none; }