fix various typos

This commit is contained in:
Sarah Hoffmann
2020-12-16 20:41:35 +01:00
parent 8676e45d88
commit 06d89e1d47
4 changed files with 15 additions and 13 deletions

View File

@@ -7,16 +7,16 @@ function loadSettings($sProjectDir)
@define('CONST_InstallDir', $sProjectDir); @define('CONST_InstallDir', $sProjectDir);
$dotenv = new \Symfony\Component\Dotenv\Dotenv(); $dotenv = new \Symfony\Component\Dotenv\Dotenv();
$dotenv->load(CONST_DataDir.'/settings/env.defaults');
if (file_exists($sProjectDir.'/.env')) { if (file_exists($sProjectDir.'/.env')) {
$dotenv->load($sProjectDir.'/.env'); $dotenv->load($sProjectDir.'/.env');
} }
$dotenv->load(CONST_DataDir.'/settings/env.defaults');
} }
function getSetting($sConfName, $sDefault = null) function getSetting($sConfName, $sDefault = null)
{ {
$sValue = $_ENV['NOMINATIM_'.$sConfName]; $sValue = $_SERVER['NOMINATIM_'.$sConfName];
if ($sDefault !== null && !$sValue) { if ($sDefault !== null && !$sValue) {
return $sDefault; return $sDefault;

View File

@@ -287,7 +287,7 @@ class SetupFunctions
public function importWikipediaArticles() public function importWikipediaArticles()
{ {
$sWikiArticlePath = getSettings('WIKIPEDIA_DATA_PATH', CONST_DataDir.'/data'); $sWikiArticlePath = getSetting('WIKIPEDIA_DATA_PATH', CONST_DataDir.'/data');
$sWikiArticlesFile = $sWikiArticlePath.'/wikimedia-importance.sql.gz'; $sWikiArticlesFile = $sWikiArticlePath.'/wikimedia-importance.sql.gz';
if (file_exists($sWikiArticlesFile)) { if (file_exists($sWikiArticlesFile)) {
info('Importing wikipedia articles and redirects'); info('Importing wikipedia articles and redirects');
@@ -723,12 +723,12 @@ class SetupFunctions
@define('CONST_NoAccessControl', ".(getSettingBool('CORS_NOACCESSCONTROL') ? 'true' : 'false')."); @define('CONST_NoAccessControl', ".(getSettingBool('CORS_NOACCESSCONTROL') ? 'true' : 'false').");
@define('CONST_Places_Max_ID_count', ".getSetting('LOOKUP_MAX_COUNT')."); @define('CONST_Places_Max_ID_count', ".getSetting('LOOKUP_MAX_COUNT').");
@define('CONST_PolygonOutput_MaximumTypes', ".getSetting('POLYGON_OUTPUT_MAX_TYPES')."); @define('CONST_PolygonOutput_MaximumTypes', ".getSetting('POLYGON_OUTPUT_MAX_TYPES').");
@define('CONST_Search_BatchMode', ".(getSettingBool('SEARCH_BATCH_MODE' ? 'true' : 'false')."); @define('CONST_Search_BatchMode', ".(getSettingBool('SEARCH_BATCH_MODE') ? 'true' : 'false').");
@define('CONST_Search_NameOnlySearchFrequencyThreshold', ".getSetting('SEARCH_NAME_ONLY_THRESHOLD')."); @define('CONST_Search_NameOnlySearchFrequencyThreshold', ".getSetting('SEARCH_NAME_ONLY_THRESHOLD').");
@define('CONST_Term_Normalization_Rules', \"".getSetting('TERM_NORMALIZATION')."\"); @define('CONST_Term_Normalization_Rules', \"".getSetting('TERM_NORMALIZATION')."\");
@define('CONST_Use_Aux_Location_data', ".(getSettingBool('USE_AUX_LOCATION_DATA') ? 'true' : 'false')."); @define('CONST_Use_Aux_Location_data', ".(getSettingBool('USE_AUX_LOCATION_DATA') ? 'true' : 'false').");
@define('CONST_Use_US_Tiger_Data', ".(getSettingBool('USE_US_TIGER_DATA') ? 'true' : 'false')."); @define('CONST_Use_US_Tiger_Data', ".(getSettingBool('USE_US_TIGER_DATA') ? 'true' : 'false').");
@define('CONST_MapIcon_URL', ".(getSetting('MAPICON_URL', 'false').'); @define('CONST_MapIcon_URL', ".getSetting('MAPICON_URL', 'false').');
'); ');
info(CONST_InstallDir.'/settings/settings-frontend.php has been set up successfully'); info(CONST_InstallDir.'/settings/settings-frontend.php has been set up successfully');
} }
@@ -755,9 +755,8 @@ class SetupFunctions
{ {
$sFName = getSetting('FLATNODE_FILE'); $sFName = getSetting('FLATNODE_FILE');
if ($sFName && file_exists($sFName)) { if ($sFName && file_exists($sFName)) {
if ($this->bVerbose) echo 'Deleting '.$sFName."\n"; if ($this->bVerbose) echo 'Deleting '.$sFName."\n";
unlink($sFName); unlink($sFName);
}
} }
} }

View File

@@ -92,7 +92,7 @@ NOMINATIM_ADDRESS_LEVEL_CONFIG=
# This may either be the name of one of an internal style or point # This may either be the name of one of an internal style or point
# to a file with a custom style. # to a file with a custom style.
# Internal styles are: admin, street, address, full, extratags # Internal styles are: admin, street, address, full, extratags
NOMNIATIM_IMPORT_STYLE=extratags NOMINATIM_IMPORT_STYLE=extratags
# Location of the flatnode file used by osm2pgsql to store node locations. # Location of the flatnode file used by osm2pgsql to store node locations.
# When unset, osm2pgsql stores the location in the PostgreSQL database. This # When unset, osm2pgsql stores the location in the PostgreSQL database. This

View File

@@ -25,9 +25,9 @@ if ($aCMDResult['wiki-import']) {
$aPairs = array(); $aPairs = array();
$sLanguageIn = getSetting( $sLanguageIn = getSetting(
LANGUAGES, 'LANGUAGES',
'af,ar,br,ca,cs,de,en,es,et,eu,fa,fi,fr,gl,hr,hu,'. 'af,ar,br,ca,cs,de,en,es,et,eu,fa,fi,fr,gl,hr,hu,'.
'ia,is,it,ja,mk,nl,no,pl,ps,pt,ru,sk,sl,sv,uk,vi'; 'ia,is,it,ja,mk,nl,no,pl,ps,pt,ru,sk,sl,sv,uk,vi'
); );
foreach (explode(',', $sLanguageIn) as $sLanguage) { foreach (explode(',', $sLanguageIn) as $sLanguage) {
@@ -109,7 +109,10 @@ if ($aCMDResult['wiki-import']) {
echo 'CREATE INDEX idx_placex_classtype ON placex (class, type);'; echo 'CREATE INDEX idx_placex_classtype ON placex (class, type);';
foreach ($aPairs as $aPair) { foreach ($aPairs as $aPair) {
$sql_tablespace = CONST_Tablespace_Aux_Data ? ' TABLESPACE '.CONST_Tablespace_Aux_Data : ''; $sql_tablespace = getSetting('TABLESPACE_AUX_DATA');
if ($sql_tablespace) {
$sql_tablespace = ' TABLESPACE '.$sql_tablespace;
}
printf( printf(
'CREATE TABLE place_classtype_%s_%s' 'CREATE TABLE place_classtype_%s_%s'
@@ -151,7 +154,7 @@ if ($aCMDResult['wiki-import']) {
. ";\n", . ";\n",
pg_escape_string($aPair[0]), pg_escape_string($aPair[0]),
pg_escape_string($aPair[1]), pg_escape_string($aPair[1]),
getSetting('DATABASE_WEBUSER'); getSetting('DATABASE_WEBUSER')
); );
} }