if ($aCMDResult['setup-db'] || $aCMDResult['all']) {
$bDidSomething = true;
- (clone($oNominatimCmd))->addParams('transition', '--setup-db')->run(true);
+ $oCmd = (clone($oNominatimCmd))->addParams('transition', '--setup-db');
+
+ if ($aCMDResult['no-partitions'] ?? false) {
+ $oCmd->addParams('--no-partitions');
+ }
+
+ $oCmd->run(true);
}
if ($aCMDResult['import-data'] || $aCMDResult['all']) {
$bDidSomething = true;
- $oSetup->importData($aCMDResult['osm-file']);
+ $oCmd = (clone($oNominatimCmd))
+ ->addParams('transition', '--import-data')
+ ->addParams('--osm-file', $aCMDResult['osm-file']);
+ if ($aCMDResult['drop'] ?? false) {
+ $oCmd->addParams('--drop');
+ }
+
+ $oCmd->run(true);
}
if ($aCMDResult['create-functions'] || $aCMDResult['all']) {
if ($aCMDResult['create-partition-functions'] || $aCMDResult['all']) {
$bDidSomething = true;
- $oSetup->createPartitionFunctions();
+ $oSetup->createFunctions(); // also create partition functions
}
if ($aCMDResult['import-wikipedia-articles'] || $aCMDResult['all']) {
$bDidSomething = true;
- $oSetup->importWikipediaArticles();
+ (clone($oNominatimCmd))->addParams('refresh', '--wiki-data')->run();
}
if ($aCMDResult['load-data'] || $aCMDResult['all']) {
if ($aCMDResult['drop']) {
$bDidSomething = true;
- $oSetup->drop($aCMDResult);
+ (clone($oNominatimCmd))->addParams('freeze')->run(true);
}
if ($aCMDResult['create-search-indices'] || $aCMDResult['all']) {
if ($aCMDResult['setup-website'] || $aCMDResult['all']) {
$bDidSomething = true;
- $oSetup->setupWebsite();
+ (clone($oNominatimCmd))->addParams('refresh', '--website')->run(true);
}
// ******************************************************