X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/3c186f80304b5b66795e9ef3cb9edb8f343c9416..c7f40e3cee2853ade0e16a90ab7a3b29b02265f9:/lib-php/admin/setup.php diff --git a/lib-php/admin/setup.php b/lib-php/admin/setup.php index cb7eeee1..f8e360bb 100644 --- a/lib-php/admin/setup.php +++ b/lib-php/admin/setup.php @@ -57,20 +57,24 @@ setupHTTPProxy(); $bDidSomething = false; $oNominatimCmd = new \Nominatim\Shell(getSetting('NOMINATIM_TOOL')); -if (isset($aCMDResult['quiet']) && $aCMDResult['quiet']) { - $oNominatimCmd->addParams('--quiet'); -} -if ($aCMDResult['verbose']) { - $oNominatimCmd->addParams('--verbose'); -} // by default, use all but one processor, but never more than 15. -var_dump($aCMDResult); $iInstances = max(1, $aCMDResult['threads'] ?? (min(16, getProcessorCount()) - 1)); -function run($oCmd) { +function run($oCmd) +{ global $iInstances; + global $aCMDResult; $oCmd->addParams('--threads', $iInstances); + if ($aCMDResult['ignore-errors'] ?? false) { + $oCmd->addParams('--ignore-errors'); + } + if ($aCMDResult['quiet'] ?? false) { + $oCmd->addParams('--quiet'); + } + if ($aCMDResult['verbose'] ?? false) { + $oCmd->addParams('--verbose'); + } $oCmd->run(true); } @@ -147,7 +151,7 @@ if ($aCMDResult['import-wikipedia-articles'] || $aCMDResult['all']) { if ($aCMDResult['load-data'] || $aCMDResult['all']) { $bDidSomething = true; - $oSetup->loadData($aCMDResult['disable-token-precalc']); + run((clone($oNominatimCmd))->addParams('transition', '--load-data')); } if ($aCMDResult['import-tiger-data']) {