X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ccca38f22d25624a420316419a697f893780d6fc..a50bf1c94495d84963c24648c1e9abffcf7adda6:/utils/setup.php diff --git a/utils/setup.php b/utils/setup.php index 97a9f301..a363fab3 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -1,7 +1,8 @@ #!/usr/bin/php -Cq 1000) fail("unable to obtain state file"); - file_put_contents(CONST_BasePath.'/settings/state.txt', $sStateFile); + file_put_contents(CONST_InstallPath.'/settings/state.txt', $sStateFile); echo "Updating DB status\n"; pg_query($oDB->connection, 'TRUNCATE import_status'); $sSQL = "INSERT INTO import_status VALUES('".$aRepMatch[2]."')"; @@ -657,7 +658,7 @@ $bDidSomething = true; $sOutputFile = ''; if (isset($aCMDResult['index-output'])) $sOutputFile = ' -F '.$aCMDResult['index-output']; - $sBaseCmd = CONST_BasePath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port'].' -t '.$iInstances.$sOutputFile; + $sBaseCmd = CONST_InstallPath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port'].' -t '.$iInstances.$sOutputFile; passthruCheckReturn($sBaseCmd.' -R 4'); if (!$aCMDResult['index-noanalyse']) pgsqlRunScript('ANALYSE'); passthruCheckReturn($sBaseCmd.' -r 5 -R 25'); @@ -709,14 +710,14 @@ fail("Target directory does not exist."); } - @symlink(CONST_BasePath.'/website/details.php', $sTargetDir.'/details.php'); - @symlink(CONST_BasePath.'/website/reverse.php', $sTargetDir.'/reverse.php'); - @symlink(CONST_BasePath.'/website/search.php', $sTargetDir.'/search.php'); - @symlink(CONST_BasePath.'/website/search.php', $sTargetDir.'/index.php'); - @symlink(CONST_BasePath.'/website/lookup.php', $sTargetDir.'/lookup.php'); - @symlink(CONST_BasePath.'/website/deletable.php', $sTargetDir.'/deletable.php'); - @symlink(CONST_BasePath.'/website/polygons.php', $sTargetDir.'/polygons.php'); - @symlink(CONST_BasePath.'/website/status.php', $sTargetDir.'/status.php'); + @symlink(CONST_InstallPath.'/website/details.php', $sTargetDir.'/details.php'); + @symlink(CONST_InstallPath.'/website/reverse.php', $sTargetDir.'/reverse.php'); + @symlink(CONST_InstallPath.'/website/search.php', $sTargetDir.'/search.php'); + @symlink(CONST_InstallPath.'/website/search.php', $sTargetDir.'/index.php'); + @symlink(CONST_InstallPath.'/website/lookup.php', $sTargetDir.'/lookup.php'); + @symlink(CONST_InstallPath.'/website/deletable.php', $sTargetDir.'/deletable.php'); + @symlink(CONST_InstallPath.'/website/polygons.php', $sTargetDir.'/polygons.php'); + @symlink(CONST_InstallPath.'/website/status.php', $sTargetDir.'/status.php'); @symlink(CONST_BasePath.'/website/images', $sTargetDir.'/images'); @symlink(CONST_BasePath.'/website/js', $sTargetDir.'/js'); @symlink(CONST_BasePath.'/website/css', $sTargetDir.'/css'); @@ -730,8 +731,12 @@ } } - if (isset($aCMDResult['drop'])) + if ($aCMDResult['drop']) { + // The implementation is potentially a bit dangerous because it uses + // a positive selection of tables to keep, and deletes everything else. + // Including any tables that the unsuspecting user might have manually + // created. USE AT YOUR OWN PERIL. $bDidSomething = true; // tables we want to keep. everything else goes. @@ -748,7 +753,9 @@ "query_log", "new_query_log", "gb_postcode", - "spatial_ref_sys" + "spatial_ref_sys", + "country_name", + "place_classtype_*" ); $oDB =& getDB();