X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2d1337e19077f5a9ac3e2f07a9c54282a7f38e28..b133f2bc4cd5e467ff6ef10124416b1307cfdb62:/utils/setup.php diff --git a/utils/setup.php b/utils/setup.php index 66b71920..713fe561 100644 --- a/utils/setup.php +++ b/utils/setup.php @@ -1,8 +1,8 @@ createDB(); } -$oSetup->connect(); - if ($aCMDResult['setup-db'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->setupDB(); } -// Try accessing the C module, so we know early if something is wrong -if (!checkModulePresence()) { - fail('error loading nominatim.so module'); -} - if ($aCMDResult['import-data'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->importData($aCMDResult['osm-file']); @@ -102,6 +93,7 @@ if ($aCMDResult['create-tables'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->createTables($aCMDResult['reverse-only']); $oSetup->createFunctions(); + $oSetup->createTableTriggers(); } if ($aCMDResult['create-partition-tables'] || $aCMDResult['all']) { @@ -126,7 +118,11 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) { if ($aCMDResult['import-tiger-data']) { $bDidSomething = true; - $oSetup->importTigerData(); + $sTigerPath = getSetting('TIGER_DATA_PATH'); + if (!$sTigerPath) { + $sTigerPath = CONST_DataDir.'/data/tiger'; + } + $oSetup->importTigerData($sTigerPath); } if ($aCMDResult['calculate-postcodes'] || $aCMDResult['all']) { @@ -139,6 +135,11 @@ if ($aCMDResult['index'] || $aCMDResult['all']) { $oSetup->index($aCMDResult['index-noanalyse']); } +if ($aCMDResult['drop']) { + $bDidSomething = true; + $oSetup->drop($aCMDResult); +} + if ($aCMDResult['create-search-indices'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->createSearchIndices(); @@ -149,9 +150,9 @@ if ($aCMDResult['create-country-names'] || $aCMDResult['all']) { $oSetup->createCountryNames($aCMDResult); } -if ($aCMDResult['drop']) { +if ($aCMDResult['setup-website'] || $aCMDResult['all']) { $bDidSomething = true; - $oSetup->drop($aCMDResult); + $oSetup->setupWebsite(); } // ******************************************************