From: Sarah Hoffmann Date: Sun, 15 Apr 2012 15:45:01 +0000 (+0200) Subject: Format of replicate-sequence URL has changed X-Git-Tag: v2.0.0~86 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/653c05329d17f9adc2e12257238717d8500ecdb6 Format of replicate-sequence URL has changed Additionally update/init import_status in the DB. If this is not initialized here, subsequent updates of the status won't work. --- diff --git a/utils/setup.php b/utils/setup.php index b1c7e5a8..d7aa3bc7 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -360,17 +360,27 @@ if (($aCMDResult['osmosis-init'] || $aCMDResult['all']) && isset($aCMDResult['osmosis-init-date'])) { $bDidSomething = true; + $oDB =& getDB(); if (!file_exists(CONST_Osmosis_Binary)) fail("please download osmosis"); if (file_exists(CONST_BasePath.'/settings/configuration.txt')) echo "settings/configuration.txt already exists\n"; else passthru(CONST_Osmosis_Binary.' --read-replication-interval-init '.CONST_BasePath.'/settings'); $sDate = $aCMDResult['osmosis-init-date']; - $sURL = 'http://toolserver.org/~mazder/replicate-sequences/?'.$sDate; + $aDate = date_parse_from_format("Y-m-d\TH-i", $sDate); + $sURL = 'http://toolserver.org/~mazder/replicate-sequences/?'; + $sURL .= 'Y='.$aDate['year'].'&m='.$aDate['month'].'&d='.$aDate['day']; + $sURL .= '&H='.$aDate['hour'].'&i='.$aDate['minute'].'&s=0'; + $sURL .= '&stream=minute'; echo "Getting state file: $sURL\n"; $sStateFile = file_get_contents($sURL); if (!$sStateFile || strlen($sStateFile) > 1000) fail("unable to obtain state file"); file_put_contents(CONST_BasePath.'/settings/state.txt', $sStateFile); + echo "Updating DB status\n"; + pg_query($oDB->connection, 'TRUNCATE import_status'); + $sSQL = "INSERT INTO import_status VALUES('".$sDate."')"; + pg_query($oDB->connection, $sSQL); + } if ($aCMDResult['index'] || $aCMDResult['all'])