Debug output for $sHeading

\n"; } public static function newSection($sHeading) { echo "

$sHeading

\n"; } public static function printVar($sHeading, $mVar) { echo '
'.$sHeading. ':  ';
        Debug::outputVar($mVar, str_repeat(' ', strlen($sHeading) + 3));
        echo "
\n"; } public static function fmtArrayVals($aArr) { return array('__debug_format' => 'array_vals', 'data' => $aArr); } public static function printDebugArray($sHeading, $oVar) { if ($oVar === null) { Debug::printVar($sHeading, 'null'); } else { Debug::printVar($sHeading, $oVar->debugInfo()); } } public static function printDebugTable($sHeading, $aVar) { echo ''.$sHeading.":\n"; echo "\n"; if (!empty($aVar)) { echo " \n"; $aKeys = array(); $aInfo = reset($aVar); if (!is_array($aInfo)) { $aInfo = $aInfo->debugInfo(); } foreach ($aInfo as $sKey => $mVal) { echo ' '."\n"; $aKeys[] = $sKey; } echo " \n"; foreach ($aVar as $oRow) { $aInfo = $oRow; if (!is_array($oRow)) { $aInfo = $oRow->debugInfo(); } echo " \n"; foreach ($aKeys as $sKey) { echo ' '."\n"; } echo " \n"; } } echo "
'.$sKey.'
';
                    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
'; } public static function printGroupTable($sHeading, $aVar) { echo ''.$sHeading.":\n"; echo "\n"; if (!empty($aVar)) { echo " \n"; echo ' '."\n"; $aKeys = array(); $aInfo = reset($aVar)[0]; if (!is_array($aInfo)) { $aInfo = $aInfo->debugInfo(); } foreach ($aInfo as $sKey => $mVal) { echo ' '."\n"; $aKeys[] = $sKey; } echo " \n"; foreach ($aVar as $sGrpKey => $aGroup) { foreach ($aGroup as $oRow) { $aInfo = $oRow; if (!is_array($oRow)) { $aInfo = $oRow->debugInfo(); } echo " \n"; echo ' '."\n"; foreach ($aKeys as $sKey) { echo ' '."\n"; } echo " \n"; } } } echo "
Group'.$sKey.'
'.$sGrpKey.'
';
                        if (!empty($aInfo[$sKey])) {
                            Debug::outputVar($aInfo[$sKey], '');
                        }
                        echo '
\n"; } public static function printSQL($sSQL) { echo '

'.$sSQL.'

'."\n"; } private static function outputVar($mVar, $sPreNL) { if (is_array($mVar) && !isset($mVar['__debug_format'])) { $sPre = ''; foreach ($mVar as $mKey => $aValue) { echo $sPre; $iKeyLen = Debug::outputSimpleVar($mKey); echo ' => '; Debug::outputVar( $aValue, $sPreNL.str_repeat(' ', $iKeyLen + 4) ); $sPre = "\n".$sPreNL; } } elseif (is_array($mVar) && isset($mVar['__debug_format'])) { if (!empty($mVar['data'])) { $sPre = ''; 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); } } private static function outputSimpleVar($mVar) { if (is_bool($mVar)) { echo ''.($mVar ? 'True' : 'False').''; return $mVar ? 4 : 5; } if (is_string($mVar)) { echo "'$mVar'"; return strlen($mVar) + 2; } echo (string)$mVar; return strlen((string)$mVar); } }