X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/832547f192904a9ec92e173c27a91e0874fcc757..51155b639b189fd7844c350f33792451ad50f3c9:/utils/server_compare.php diff --git a/utils/server_compare.php b/utils/server_compare.php index 8564ae57..f86a015b 100755 --- a/utils/server_compare.php +++ b/utils/server_compare.php @@ -13,27 +13,23 @@ $sHost2Escaped = str_replace('/', '\\/', $sHost2); $aToDo = array(251, 293, 328, 399.1, 455.1, 479, 496, 499, 574, 609, 702, 790, 846, 865, 878, 894, 902, 961, 980); $hFile = @fopen($sFile, "r"); -if (!$hFile) -{ +if (!$hFile) { echo "Unable to open file: $sFile\n"; exit; } $i = 0; -while (($sLine = fgets($hFile, 10000)) !== false) -{ +while (($sLine = fgets($hFile, 10000)) !== false) { $i++; if (!in_array($i, $aToDo)) continue; - if (preg_match('#"GET (.*) HTTP/1.[01]"#', $sLine, $aResult)) - { + if (preg_match('#"GET (.*) HTTP/1.[01]"#', $sLine, $aResult)) { $sURL1 = $sHost1.$aResult[1]; $sURL2 = $sHost2.$aResult[1]; $sRes1 = ''; $k = 0; - while(!$sRes1 && $k < 10) - { + while (!$sRes1 && $k < 10) { $sRes1 = file_get_contents($sURL1); $k++; if (!$sRes1) sleep(10); @@ -48,29 +44,24 @@ while (($sLine = fgets($hFile, 10000)) !== false) $sRes2 = str_replace($sHost2, '', $sRes2); $sRes2 = str_replace($sHost2Escaped, '', $sRes2); - if ($sRes1 != $sRes2) - { + if ($sRes1 != $sRes2) { echo "$i:\n"; var_dump($sURL1, $sURL2); $sRes = $sURL1.":\n"; - for ($j = 0; $j < strlen($sRes1); $j+=40) - { + for ($j = 0; $j < strlen($sRes1); $j+=40) { $sRes .= substr($sRes1, $j, 40)."\n"; } file_put_contents('log/'.$i.'.1', $sRes); $sRes = $sURL2.":\n"; - for ($j = 0; $j < strlen($sRes2); $j+=40) - { + for ($j = 0; $j < strlen($sRes2); $j+=40) { $sRes .= substr($sRes2, $j, 40)."\n"; } file_put_contents('log/'.$i.'.2', $sRes); } echo ".\n"; - } - else - { + } else { var_dump($sLine); } }