@define('CONST_InstallDir', $sProjectDir);
$dotenv = new \Symfony\Component\Dotenv\Dotenv();
+ $dotenv->load(CONST_DataDir.'/settings/env.defaults');
if (file_exists($sProjectDir.'/.env')) {
$dotenv->load($sProjectDir.'/.env');
}
- $dotenv->load(CONST_DataDir.'/settings/env.defaults');
}
function getSetting($sConfName, $sDefault = null)
{
- $sValue = $_ENV['NOMINATIM_'.$sConfName];
+ $sValue = $_SERVER['NOMINATIM_'.$sConfName];
if ($sDefault !== null && !$sValue) {
return $sDefault;
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';
if (file_exists($sWikiArticlesFile)) {
info('Importing wikipedia articles and redirects');
@define('CONST_NoAccessControl', ".(getSettingBool('CORS_NOACCESSCONTROL') ? 'true' : 'false').");
@define('CONST_Places_Max_ID_count', ".getSetting('LOOKUP_MAX_COUNT').");
@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_Term_Normalization_Rules', \"".getSetting('TERM_NORMALIZATION')."\");
@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_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');
}
{
$sFName = getSetting('FLATNODE_FILE');
if ($sFName && file_exists($sFName)) {
- if ($this->bVerbose) echo 'Deleting '.$sFName."\n";
- unlink($sFName);
- }
+ if ($this->bVerbose) echo 'Deleting '.$sFName."\n";
+ unlink($sFName);
}
}
# This may either be the name of one of an internal style or point
# to a file with a custom style.
# 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.
# When unset, osm2pgsql stores the location in the PostgreSQL database. This
$aPairs = array();
$sLanguageIn = getSetting(
- LANGUAGES,
+ 'LANGUAGES',
'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) {
echo 'CREATE INDEX idx_placex_classtype ON placex (class, type);';
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(
'CREATE TABLE place_classtype_%s_%s'
. ";\n",
pg_escape_string($aPair[0]),
pg_escape_string($aPair[1]),
- getSetting('DATABASE_WEBUSER');
+ getSetting('DATABASE_WEBUSER')
);
}