X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/f6e894a53af83a69f553555cb4a6248d57a58391..db5e78c8792a62c5e2c4e6b18f12b0d55151b1ed:/lib-php/admin/setup.php diff --git a/lib-php/admin/setup.php b/lib-php/admin/setup.php index 902c24e0..6fca7c3c 100644 --- a/lib-php/admin/setup.php +++ b/lib-php/admin/setup.php @@ -86,12 +86,25 @@ if ($aCMDResult['create-db'] || $aCMDResult['all']) { 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']) { @@ -113,12 +126,12 @@ if ($aCMDResult['create-partition-tables'] || $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']) { @@ -144,7 +157,7 @@ if ($aCMDResult['index'] || $aCMDResult['all']) { if ($aCMDResult['drop']) { $bDidSomething = true; - $oSetup->drop($aCMDResult); + (clone($oNominatimCmd))->addParams('freeze')->run(true); } if ($aCMDResult['create-search-indices'] || $aCMDResult['all']) { @@ -159,7 +172,7 @@ if ($aCMDResult['create-country-names'] || $aCMDResult['all']) { if ($aCMDResult['setup-website'] || $aCMDResult['all']) { $bDidSomething = true; - $oSetup->setupWebsite(); + (clone($oNominatimCmd))->addParams('refresh', '--website')->run(true); } // ******************************************************