X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9b76a8ffb4c4cd13628d85c00cf286382970b149..7b44cb9577ca6b9fb6c82be86a343730cf4ed5b8:/lib/DebugHtml.php diff --git a/lib/DebugHtml.php b/lib/DebugHtml.php index ce2b8361..a600fae5 100644 --- a/lib/DebugHtml.php +++ b/lib/DebugHtml.php @@ -39,33 +39,48 @@ class Debug public static function printDebugTable($sHeading, $aVar) { echo ''.$sHeading.":\n"; - echo ''; + echo "
\n"; if (!empty($aVar)) { - echo ''; + echo " \n"; $aKeys = array(); $aInfo = reset($aVar); if (!is_array($aInfo)) { $aInfo = $aInfo->debugInfo(); } foreach ($aInfo as $sKey => $mVal) { - echo ''; + echo ' '."\n"; $aKeys[] = $sKey; } - echo ''; + echo " \n"; foreach ($aVar as $oRow) { $aInfo = $oRow; if (!is_array($oRow)) { $aInfo = $oRow->debugInfo(); } - echo ''; + echo " \n"; foreach ($aKeys as $sKey) { - echo ''; + echo ''."\n"; } - echo ''; + echo " \n"; + } + } + echo "
'.$sKey.''.$sKey.'
';
+                    echo '    
';
                     if (isset($aInfo[$sKey])) {
                         Debug::outputVar($aInfo[$sKey], '');
                     }
-                    echo '
\n"; + } + + public static function printGroupedSearch($aSearches, $aWordsIDs) + { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + foreach ($aSearches as $iRank => $aRankedSet) { + foreach ($aRankedSet as $aRow) { + $aRow->dumpAsHtmlTableRow($aWordsIDs); } } echo '
rankName TokensName NotAddress TokensAddress Notcountryoperatorclasstypepostcodehousenumber
'; @@ -74,38 +89,40 @@ class Debug public static function printGroupTable($sHeading, $aVar) { echo ''.$sHeading.":\n"; - echo ''; + echo "
\n"; if (!empty($aVar)) { - echo ''; + echo " \n"; + echo ' '."\n"; $aKeys = array(); - $aInfo = reset(reset($aVar)); + $aInfo = reset($aVar)[0]; if (!is_array($aInfo)) { $aInfo = $aInfo->debugInfo(); } foreach ($aInfo as $sKey => $mVal) { - echo ''; + echo ' '."\n"; $aKeys[] = $sKey; } - echo ''; + echo " \n"; foreach ($aVar as $sGrpKey => $aGroup) { foreach ($aGroup as $oRow) { $aInfo = $oRow; if (!is_array($oRow)) { $aInfo = $oRow->debugInfo(); } - echo ''; + echo " \n"; + echo ' '."\n"; foreach ($aKeys as $sKey) { - echo ''; + echo ''."\n"; } - echo ''; + echo " \n"; } } } - echo '
Group
Group'.$sKey.''.$sKey.'
'.$sGrpKey.'
'.$sGrpKey.'
';
+                        echo '    
';
                         if (!empty($aInfo[$sKey])) {
                             Debug::outputVar($aInfo[$sKey], '');
                         }
-                        echo '
'; + echo "\n"; } public static function printSQL($sSQL) @@ -128,14 +145,16 @@ class Debug $sPre = "\n".$sPreNL; } } elseif (is_array($mVar) && isset($mVar['__debug_format'])) { - if (!empty($mVar[data])) { + if (!empty($mVar['data'])) { $sPre = ''; - foreach ($mVar[data] as $mValue) { + foreach ($mVar['data'] as $mValue) { echo $sPre; Debug::outputSimpleVar($mValue); $sPre = ', '; } } + } elseif (is_object($mVar) && method_exists($mVar, 'debugInfo')) { + Debug::outputVar($mVar->debugInfo(), $sPreNL); } else { Debug::outputSimpleVar($mVar); }