#!/usr/bin/php -Cq
<?php
- require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php');
- ini_set('memory_limit', '800M');
+ require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+ require_once(CONST_BasePath.'/lib/init-cmd.php');
+ ini_set('memory_limit', '800M');
$aCMDOptions = array(
"Import / update / index osm data",
}
*/
- // Assume osm2pgsql is in the folder above
- $sBasePath = dirname(dirname(__FILE__));
-
date_default_timezone_set('Etc/UTC');
$oDB =& getDB();
if ($aResult['index'])
{
- passthru(CONST_BasePath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port'].' -t '.$aResult['index-instances'].' -r '.$aResult['index-rank']);
+ passthru(CONST_InstallPath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port'].' -t '.$aResult['index-instances'].' -r '.$aResult['index-rank']);
}
if ($aResult['import-osmosis'] || $aResult['import-osmosis-all'])
$sImportFile = CONST_BasePath.'/data/osmosischange.osc';
$sOsmosisCMD = CONST_Osmosis_Binary;
- $sOsmosisConfigDirectory = CONST_BasePath.'/settings';
+ $sOsmosisConfigDirectory = CONST_InstallPath.'/settings';
$sCMDDownload = $sOsmosisCMD.' --read-replication-interval workingDirectory='.$sOsmosisConfigDirectory.' --simplify-change --write-xml-change '.$sImportFile;
$sCMDCheckReplicationLag = $sOsmosisCMD.' -q --read-replication-lag workingDirectory='.$sOsmosisConfigDirectory;
$sCMDImport = $sOsm2pgsqlCmd.' '.$sImportFile;
- $sCMDIndex = $sBasePath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port'].' -t '.$aResult['index-instances'];
+ $sCMDIndex = CONST_InstallPath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port'].' -t '.$aResult['index-instances'];
if (!$aResult['no-npi']) {
$sCMDIndex .= '-F ';
}
var_dump($iNPIID);
exit(1);
}
- $sConfigDirectory = CONST_BasePath.'/settings';
- $sCMDImportTemplate = $sBasePath.'/nominatim/nominatim -d gazetteer -P 5433 -I -T '.$sBasePath.'/nominatim/partitionedtags.def -F ';
+ $sConfigDirectory = CONST_InstallPath.'/settings';
+ $sCMDImportTemplate = CONST_InstallPath.'/nominatim/nominatim -d gazetteer -P 5433 -I -T '.CONST_BasePath.'/settings/partitionedtags.def -F ';
while(true)
{
$fStartTime = time();