X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/effd8e12af440586594a18a04beb33abed260d15..cecbfb8e4c8c3265a9d9222d7dadeb11ebdd034c:/wikidata/pull_wikipedia_logs.php diff --git a/wikidata/pull_wikipedia_logs.php b/wikidata/pull_wikipedia_logs.php index 3c5f5dfe..a7f6a9a3 100644 --- a/wikidata/pull_wikipedia_logs.php +++ b/wikidata/pull_wikipedia_logs.php @@ -1,17 +1,14 @@ $sDayKey || $sPrevKey === false)) - { + } elseif ($sDayKey !== false && ($sPrevKey > $sDayKey || $sPrevKey === false)) { fputs($hNewTotals, "$sDayKey ".($iDayValue)."\n"); $sDayLine = true; - } - else if ($sPrevKey !== false && ($sDayKey > $sPrevKey || $sDayKey === false)) - { + } elseif ($sPrevKey !== false && ($sDayKey > $sPrevKey || $sDayKey === false)) { fputs($hNewTotals, "$sPrevKey ".($iPrevValue)."\n"); $sPrevLine = true; } - if ($sPrevLine === true) - { + if ($sPrevLine === true) { $sPrevLine = $hPrevTotals?fgets($hPrevTotals, 4096):false; - if ($sPrevLine !== false) - { + if ($sPrevLine !== false) { $aPrevLine = explode(' ', $sPrevLine); $sPrevKey = $aPrevLine[0].' '.$aPrevLine[1]; $iPrevValue = (int)$aPrevLine[2]; - } - else - { + } else { $sPrevKey = false; $iPrevValue = 0; } } - if ($sDayLine === true) - { + if ($sDayLine === true) { $sDayLine = $hDayTotals?fgets($hDayTotals, 4096):false; - if ($sDayLine !== false) - { + if ($sDayLine !== false) { preg_match('#^([a-z]{2}) ([^ :]+) ([0-9]+) [0-9]+$#', $sDayLine, $aMatch); $sDayKey = $aMatch[1].' '.$aMatch[2]; $iDayValue = (int)$aMatch[3]; - } - else - { + } else { $sDayKey = false; $iDayValue = 0; } } - } while ($sPrevLine !== false || $sDayLine !== false); @fclose($hPrevTotals);