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 ''.$sKey.' | ';
+ echo ' '.$sKey.' | '."\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 ' ';
if (isset($aInfo[$sKey])) {
Debug::outputVar($aInfo[$sKey], '');
}
- echo ' | ';
+ echo ' | '."\n";
}
- echo '
';
+ echo "
\n";
+ }
+ }
+ echo "
\n";
+ }
+
+ public static function printGroupedSearch($aSearches, $aWordsIDs)
+ {
+ echo '';
+ echo 'rank | Name Tokens | Name Not | ';
+ echo 'Address Tokens | Address Not | ';
+ echo 'country | operator | ';
+ echo 'class | type | postcode | housenumber |
';
+ foreach ($aSearches as $iRank => $aRankedSet) {
+ foreach ($aRankedSet as $aRow) {
+ $aRow->dumpAsHtmlTableRow($aWordsIDs);
}
}
echo '
';
@@ -74,38 +89,40 @@ class Debug
public static function printGroupTable($sHeading, $aVar)
{
echo ''.$sHeading.":\n";
- echo '';
+ echo "\n";
if (!empty($aVar)) {
- echo 'Group | ';
+ echo "
---|
\n";
+ echo ' Group | '."\n";
$aKeys = array();
- $aInfo = reset(reset($aVar));
+ $aInfo = reset($aVar)[0];
if (!is_array($aInfo)) {
$aInfo = $aInfo->debugInfo();
}
foreach ($aInfo as $sKey => $mVal) {
- echo ''.$sKey.' | ';
+ echo ' '.$sKey.' | '."\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 ''.$sGrpKey.' | ';
+ echo "
\n";
+ echo ' '.$sGrpKey.' | '."\n";
foreach ($aKeys as $sKey) {
- echo '';
+ echo ' ';
if (!empty($aInfo[$sKey])) {
Debug::outputVar($aInfo[$sKey], '');
}
- echo ' | ';
+ echo ' | '."\n";
}
- echo '
';
+ echo "
\n";
}
}
}
- 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);
}