X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/64fa70ac0aaaad3e2fa881cde7c7f2050e151141..ff5a2372001b024e2e11d6d4db8d69809b1e5d29:/lib/DebugHtml.php?ds=inline diff --git a/lib/DebugHtml.php b/lib/DebugHtml.php index ce2b8361..98da8794 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,18 @@ 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); + } elseif (is_a($mVar, 'stdClass')) { + Debug::outputVar(json_decode(json_encode($mVar), true), $sPreNL); } else { Debug::outputSimpleVar($mVar); }