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']); } if ($aCMDResult['create-functions'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->createFunctions(); } if ($aCMDResult['create-tables'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->createTables($aCMDResult['reverse-only']); $oSetup->createFunctions(); } if ($aCMDResult['create-partition-tables'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->createPartitionTables(); } if ($aCMDResult['create-partition-functions'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->createPartitionFunctions(); } if ($aCMDResult['import-wikipedia-articles'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->importWikipediaArticles(); } if ($aCMDResult['load-data'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->loadData($aCMDResult['disable-token-precalc']); } if ($aCMDResult['import-tiger-data']) { $bDidSomething = true; $oSetup->importTigerData(); } if ($aCMDResult['calculate-postcodes'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->calculatePostcodes($aCMDResult['all']); } if ($aCMDResult['index'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->index($aCMDResult['index-noanalyse']); } if ($aCMDResult['create-search-indices'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->createSearchIndices(); } if ($aCMDResult['create-country-names'] || $aCMDResult['all']) { $bDidSomething = true; $oSetup->createCountryNames($aCMDResult); } if ($aCMDResult['drop']) { $bDidSomething = true; $oSetup->drop($aCMDResult); } // ****************************************************** // If we did something, repeat the warnings if (!$bDidSomething) { showUsage($aCMDOptions, true); } else { echo "Summary of warnings:\n\n"; repeatWarnings(); echo "\n"; info('Setup finished.'); }