X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2c42bda9cef0877ac2f14f0e5353876e3abd8d73..3b20b11a9fb87dee1c73412366abe9a3eb5891a5:/lib/DebugHtml.php 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); }