]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/setup_functions.php
switch remaining settings to dotenv format
[nominatim.git] / lib / setup_functions.php
index 5aa5919b2e63ec5f768c19d24033796b3441ebb8..a2287d9bf794fc19bfa5a9140324ec581896f24b 100755 (executable)
@@ -14,3 +14,24 @@ function checkInFile($sOSMFile)
         fail('osm-file "' . $aCMDResult['osm-file'] . '" not readable');
     }
 }
+
+function getOsm2pgsqlBinary()
+{
+    $sBinary = getSetting('OSM2PGSQL_BINARY');
+    if (!$sBinary) {
+        $sBinary = CONST_InstallDir.'/osm2pgsql/osm2pgsql';
+    }
+
+    return $sBinary;
+}
+
+function getImportStyle()
+{
+    $sStyle = getSetting('IMPORT_STYLE');
+
+    if (in_array($sStyle, array('admin', 'street', 'address', 'full', 'extratags'))) {
+        return CONST_DataDir.'/settings/import-'.$sStyle.'.style';
+    }
+
+    return $sStyle;
+}