]> git.openstreetmap.org Git - nominatim.git/blob - lib-php/setup_functions.php
Merge pull request #2164 from lonvia/add-make-install
[nominatim.git] / lib-php / 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     $sBinary = getSetting('OSM2PGSQL_BINARY');
21
22     return $sBinary ? $sBinary : CONST_Default_Osm2pgsql;
23 }
24
25 function getImportStyle()
26 {
27     $sStyle = getSetting('IMPORT_STYLE');
28
29     if (in_array($sStyle, array('admin', 'street', 'address', 'full', 'extratags'))) {
30         return CONST_ConfigDir.'/import-'.$sStyle.'.style';
31     }
32
33     return $sStyle;
34 }