]> git.openstreetmap.org Git - nominatim.git/blob - lib/setup_functions.php
configure osm2pgsql and module location via cmake
[nominatim.git] / lib / setup_functions.php
1 <?php
2
3 function checkInFile($sOSMFile)
4 {
5     if (!isset($sOSMFile)) {
6         fail('missing --osm-file for data import');
7     }
8
9     if (!file_exists($sOSMFile)) {
10         fail('the path supplied to --osm-file does not exist');
11     }
12
13     if (!is_readable($sOSMFile)) {
14         fail('osm-file "' . $aCMDResult['osm-file'] . '" not readable');
15     }
16 }
17
18 function getOsm2pgsqlBinary()
19 {
20     return getSetting('OSM2PGSQL_BINARY', CONST_Default_Osm2pgsql);
21 }
22
23 function getImportStyle()
24 {
25     $sStyle = getSetting('IMPORT_STYLE');
26
27     if (in_array($sStyle, array('admin', 'street', 'address', 'full', 'extratags'))) {
28         return CONST_DataDir.'/settings/import-'.$sStyle.'.style';
29     }
30
31     return $sStyle;
32 }