From 4713f572d00bcce07cb0fd4d880f1fd584b5d787 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 19 Dec 2020 10:50:08 -0800 Subject: [PATCH] Remove old css classes from debug info. --- class2.php | 12 +- e107_admin/footer.php | 8 +- e107_core/templates/footer_default.php | 9 +- e107_handlers/db_debug_class.php | 156 +++++++++--------- e107_handlers/traffic_class_display.php | 209 +++++++++++++----------- e107_web/css/e107.css | 7 +- 6 files changed, 215 insertions(+), 186 deletions(-) diff --git a/class2.php b/class2.php index 9efc7c47e..89e820f16 100755 --- a/class2.php +++ b/class2.php @@ -2630,15 +2630,15 @@ class error_handler { $text .= " - ".$key." - "; + ".$key." + "; $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 .=" - "; + "; $text .= str_replace($this->docroot,'', $val['file']).":".$val['line']; $text .= " "; @@ -2664,7 +2664,7 @@ class error_handler foreach ($this->errors as $key => $value) { - $ret .= "\t\n\t\t{$value['short']}\n"; + $ret .= "\t\n\t\t{$value['short']}\n"; $ret .= "\n\t"; $ret .= "\t\n".$this->render_trace($value['trace'])."\n"; @@ -2676,11 +2676,11 @@ class error_handler { foreach ($this->errors as $key => $value) { - $ret .= "{$value['short']}\n"; + $ret .= "{$value['short']}\n"; } } - return ($ret) ? "\n".$ret."
" : FALSE; + return ($ret) ? "\n".$ret."
" : FALSE; } /** diff --git a/e107_admin/footer.php b/e107_admin/footer.php index 11e64d38c..b99dbc276 100644 --- a/e107_admin/footer.php +++ b/e107_admin/footer.php @@ -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 "
- +
- \n\n"; + \n\n"; foreach ($queryinfo as $infovalue) { - echo "\n\n\n"; + echo "\n\n\n"; $c++; } echo "
IDSQL Queries
IDSQL Queries
{$c}{$infovalue}
{$c}{$infovalue}
"; diff --git a/e107_core/templates/footer_default.php b/e107_core/templates/footer_default.php index d9b0392db..22feb8a64 100644 --- a/e107_core/templates/footer_default.php +++ b/e107_core/templates/footer_default.php @@ -203,12 +203,15 @@ if (ADMIN && isset($queryinfo) && is_array($queryinfo)) { $c = 1; $mySQLInfo = $sql->mySQLinfo; - echo "
+ echo "
+

SQL

+
- \n\n"; + \n\n"; foreach ($queryinfo as $infovalue) { - echo "\n\n\n"; + echo "\n + \n\n"; $c++; } echo "
IDSQL Queries
IDSQL Queries
{$c}{$infovalue}
{$c}{$infovalue}
"; diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index 819b139fc..f1220432d 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -251,9 +251,9 @@ if(!$bRowHeaders) { $bRowHeaders = true; - $t['explain'] = "" . implode("", array_keys($row)) . "\n"; + $t['explain'] = "" . implode("", array_keys($row)) . "\n"; } - $t['explain'] .= "" . implode(" ", array_values($row)) . " \n"; + $t['explain'] .= "" . implode(" ", array_values($row)) . " \n"; } } else @@ -323,16 +323,16 @@ if($badCount) { - $text .= "\n\n"; - $text .= "\n"; - $text .= "\n"; + $text .= "\n
$badCount Query Errors!
IndexQuery / Error
\n"; + $text .= "\n"; + $text .= "\n"; foreach($this->aSQLdetails as $idx => $cQuery) { if(!$cQuery['ok']) { - $text .= " - \n\n"; + $text .= " + \n\n"; } } $text .= "\n
$badCount Query Errors!
IndexQuery / Error
{$idx} " . $cQuery['query'] . "
" . $cQuery['error'] . "
{$idx} " . $cQuery['query'] . "
" . $cQuery['error'] . "

\n"; @@ -344,10 +344,10 @@ if($okCount && E107_DBG_SQLDETAILS) { - $text .= "\n\n"; - $text .= "\n"; - $text .= "\n - \n + $text .= "\n
" . $this->countLabel($okCount) . " Good Queries
IndexQtimeQuery
 (msec) 
\n"; + $text .= "\n"; + $text .= "\n + \n "; $count = 0; @@ -362,9 +362,9 @@ if($cQuery['ok']) { - $text .= " - - \n"; + $text .= " + + \n"; $count++; } @@ -383,18 +383,18 @@ $count = 0; foreach($this->aSQLdetails as $idx => $cQuery) { - $text .= "\n
" . $this->countLabel($okCount) . " Good Queries
IndexQtimeQuery
 (msec) 
{$idx} " . number_format($cQuery['time'] * 1000.0, 4) . " " . $cQuery['query'] . '
[' . $cQuery['marker'] . " - " . $cQuery['caller'] . "]
{$idx} " . number_format($cQuery['time'] * 1000.0, 4) . " " . $cQuery['query'] . '
[' . $cQuery['marker'] . " - " . $cQuery['caller'] . "]
\n"; - $text .= "\n"; + $text .= "\n
" . $idx . ") Query: [" . $cQuery['marker'] . " - " . $cQuery['caller'] . "]
" . $cQuery['query'] . "
\n"; + $text .= "\n"; if(isset($cQuery['explain'])) { $text .= $cQuery['explain']; } if(strlen($cQuery['error'])) { - $text .= "\n\n"; + $text .= "\n\n"; } - $text .= "'; + $text .= "'; $text .= '
" . $idx . ") Query: [" . $cQuery['marker'] . " - " . $cQuery['caller'] . "]
" . $cQuery['query'] . "
Error in query:
" . $cQuery['error'] . "
Error in query:
" . $cQuery['error'] . "
Query time: " . number_format($cQuery['time'] * 1000.0, 4) . ' (ms)
Query time: " . number_format($cQuery['time'] * 1000.0, 4) . ' (ms)

' . "\n"; @@ -485,7 +485,7 @@ $totTime = e107::getSingleton('e107_traffic')->TimeDelta($eTimingStart, $eTimingStop); - $text = "\n\n"; + $text = "\n
\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 .= "\n"; + $text .= "\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 .= "\n"; + $text .= "\n"; } @@ -614,11 +614,11 @@ $tMarker['OB Lev'] = $this->aOBMarks[$tKey]; } - $text .= "\n"; + $text .= "\n"; if(isset($this->aMarkNotes[$tKey])) { - $text .= "\n"; } @@ -636,24 +636,24 @@ $text .= " - - - - - - - - - - + + "; - // $text .= "\n"; + // $text .= "\n"; $text .= "\n
" . implode(" ", array_keys($tMarker)) . " OB Lev 
" . implode(" ", array_keys($tMarker)) . " OB Lev 
" . implode(" ", $aUnits) . " 
" . implode(" ", $aUnits) . " 
" . implode(" ", array_values($tMarker)) . " 
" . implode(" ", array_values($tMarker)) . " 
 "; + $text .= "
 "; $text .= $this->aMarkNotes[$tKey] . "
 Total" . $aSum['%Time'] . "" . $aSum['%DB Time'] . "" . $aSum['%DB Count'] . "" . $aSum['Time'] . "" . $aSum['DB Time'] . "" . $aSum['DB Count'] . "" . number_format($aSum['Memory'] / 1024, 1) . "" . number_format($aSum['Memory'] / 1024, 1) . "  + Total + " . $aSum['%Time'] . " + " . $aSum['%DB Time'] . " + " . $aSum['%DB Count'] . " + " . $aSum['Time'] . " + " . $aSum['DB Time'] . " + " . $aSum['DB Count'] . " + " . number_format($aSum['Memory'] / 1024, 1) . " + " . number_format($aSum['Memory'] / 1024, 1) . " - " . $tMarker['OB Lev'] . "" . $tMarker['OB Lev'] . "
".implode(" ", $aSum)."  
".implode(" ", $aSum)."  

\n"; @@ -662,7 +662,7 @@ // Stats by Table // - $text .= "\n + $text .= "\n
@@ -684,7 +684,7 @@ if(!$bRowHeaders) { $bRowHeaders = true; - $text .= "\n"; + $text .= "\n"; $aUnits = $curTable; foreach($aUnits as $key => $val) { @@ -698,7 +698,7 @@ break; } } - $text .= "\n"; + $text .= "\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 .= "\n"; + $text .= "\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 .= "\n"; + $text .= "\n"; $text .= "\n
" . implode("", array_keys($curTable)) . "
" . implode("", array_keys($curTable)) . "
" . implode(" ", $aUnits) . " 
" . implode(" ", $aUnits) . " 
" . implode(" ", array_values($curTable)) . " 
" . implode(" ", array_values($curTable)) . " 
" . implode(" ", array_values($aSum)) . " 
" . implode(" ", array_values($aSum)) . " 

\n"; return $text; @@ -760,14 +760,14 @@ return false; } - $text = " + $text = "
- - - - + + + + \n"; @@ -781,10 +781,10 @@ $type = $codes['type']; $text .= " - - - - + + + + \n"; } $text .= "
TypeCodeParmDetailsTypeCodeParmDetails
" . ($description[$type]) . "" . (isset($codes['code']) ? $codes['code'] : " ") . "" . ($codes['parm'] ? $codes['parm'] : " ") . "" . ($codes['details'] ? $codes['details'] : " ") . "" . ($description[$type]) . "" . (isset($codes['code']) ? $codes['code'] : " ") . "" . ($codes['parm'] ? $codes['parm'] : " ") . "" . ($codes['details'] ? $codes['details'] : " ") . "
"; @@ -803,14 +803,14 @@ global $e107; $sql = e107::getDb(); - $text = " + $text = " - + \n"; @@ -831,8 +831,8 @@ { $text .= " - - + + "; } } @@ -843,39 +843,39 @@ - - + + "; if($_SERVER['E_DEV'] == 'true') { $text .= " - + "; } $text .= " - + - - + + - - + + - - + + - + @@ -894,13 +894,13 @@ } else { - $text = " - + $text = "
The following deprecated functions were used:
+ - - - + + + \n"; @@ -908,9 +908,9 @@ foreach($this->deprecated_funcs as $funcs) { $text .= " - - - + + + \n"; } $text .= "
The following deprecated functions were used:
FunctionFileLineFunctionFileLine
{$funcs['func']}(){$funcs['file']}{$funcs['line']}{$funcs['func']}(){$funcs['file']}{$funcs['line']}
"; @@ -1009,7 +1009,7 @@ // Dump the debug log // - $text = "\n\n"; + $text = "\n
\n"; $bRowHeaders = false; @@ -1018,10 +1018,10 @@ if(!$bRowHeaders) { $bRowHeaders = true; - $text .= "\n"; + $text .= "\n"; } - $text .= "\n"; + $text .= "\n"; } $text .= "
" . implode("", array_keys($curLog)) . "
" . implode("", array_keys($curLog)) . "
" . implode(" ", array_values($curLog)) . " 
" . implode(" ", array_values($curLog)) . " 

\n"; @@ -1038,9 +1038,9 @@ } - $text = "\n"; - $text .= "\n
" . - implode(" 
", $this->aIncList) . + $text = "\n"; + $text .= "\n\n"; $text .= "
" . + implode(" 
", $this->aIncList) . " 
\n"; diff --git a/e107_handlers/traffic_class_display.php b/e107_handlers/traffic_class_display.php index b829f98a1..3f04d3147 100644 --- a/e107_handlers/traffic_class_display.php +++ b/e107_handlers/traffic_class_display.php @@ -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\n"; - $text .= " +if (count($this->aTraffic)) +{ // Simple counts + $text .= "\n
\n"; + $text .= " - - - + + + \n"; - foreach ($this->aTraffic as $key=>$aVals) { - $text .= " - - \n"; - - if (isset($this->aTrafficWho[$key])) { - $text .= " - \n"; - } - - } - $text .="
ItemCount  ItemCount  
". - $key."". - $aVals['Count']."  
Callers:"; - $bFirst=TRUE; - foreach ($this->aTrafficWho[$key] as $sWho) { - if ($bFirst ) { - $bFirst = FALSE; - } else { - $text .= "
\n"; - } - $text .= $sWho; - } - $text .= "

\n"; - } - // - // Fancy timed counts - // - if (count($this->aTrafficTimed)) { - $text .= "\n\n"; - $text .= " + foreach ($this->aTraffic as $key => $aVals) + { + $text .= " + + \n"; + + if (isset($this->aTrafficWho[$key])) + { + $text .= " + \n"; + } + + } + $text .= "
" . + $key . "" . + $aVals['Count'] . "  
Callers:"; + $bFirst = true; + foreach ($this->aTrafficWho[$key] as $sWho) + { + if ($bFirst) + { + $bFirst = false; + } + else + { + $text .= "
\n"; + } + $text .= $sWho; + } + $text .= "

\n"; +} +// +// Fancy timed counts +// +if (count($this->aTrafficTimed)) +{ + $text .= "\n\n"; + $text .= " - - - - - - + + + + + + \n"; - - - foreach ($this->aTrafficTimed as $key=>$aVals) { - if (substr($key,0,8)=='TRAF_CAL') continue; - $text .= " - - "; - 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 .= " - - - - \n"; - - if (isset($this->aTrafficWho[$key])) { - $text .= " - \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 .=" + + "; + 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 .= " + + + + \n"; + + if (isset($this->aTrafficWho[$key])) + { + $text .= " + \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 .= "\n"; - $text .="
ItemCount Tot Time (ms) Avg Time (us) Min Time (us) Max Time (us) ItemCount Tot Time (ms) Avg Time (us) Min Time (us) Max Time (us) 
". - $key."". - $aVals['Count']." ". - $sTot." ". - $sAvg." ". - $sMin." ". - $sMax." 
Callers:"; - $bFirst=TRUE; - foreach ($this->aTrafficWho[$key] as $sWho) { - if ($bFirst ) { - $bFirst = FALSE; - } else { - $text .= "
\n"; - } - $text .= $sWho; - } - $text .= "
+ + foreach ($this->aTrafficTimed as $key => $aVals) + { + if (substr($key, 0, 8) == 'TRAF_CAL') + { + continue; + } + $text .= "
" . + $key . "" . + $aVals['Count'] . " " . + $sTot . " " . + $sAvg . " " . + $sMin . " " . + $sMax . " 
Callers:"; + $bFirst = true; + foreach ($this->aTrafficWho[$key] as $sWho) + { + if ($bFirst) + { + $bFirst = false; + } + else + { + $text .= "
\n"; + } + $text .= $sWho; + } + $text .= "
Note: These times have been decreased by the calibration offset:
$cal2 usec per call(start,stop); $cal1 usec per call(start). Total adjustment: $cTot msec.

\n"; - } + $text .= "

\n"; +} diff --git a/e107_web/css/e107.css b/e107_web/css/e107.css index 5ef70aa05..ec947f86f 100644 --- a/e107_web/css/e107.css +++ b/e107_web/css/e107.css @@ -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; } \ No newline at end of file +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; } \ No newline at end of file