]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/setup.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / utils / setup.php
index 45b40fedfc463bb7b0f3d32183628958e5953670..6bd2105574519405a831cbaeabd30f8b3ee86d5f 100755 (executable)
@@ -95,7 +95,7 @@
                {
                        fail('database already exists ('.CONST_Database_DSN.')');
                }
-               passthruCheckReturn('createdb -E UTF-8 '.$aDSNInfo['database']);
+               passthruCheckReturn('createdb -E UTF-8 -p '.$aDSNInfo['port'].' '.$aDSNInfo['database']);
        }
 
        if ($aCMDResult['setup-db'] || $aCMDResult['all'])
                        exit;
                }
 
-               passthru('createlang plpgsql '.$aDSNInfo['database']);
+               passthru('createlang plpgsql -p '.$aDSNInfo['port'].' '.$aDSNInfo['database']);
                $pgver = (float) CONST_Postgresql_Version;
                if ($pgver < 9.1) {
                        pgsqlRunScriptFile(CONST_Path_Postgresql_Contrib.'/hstore.sql');
                $osm2pgsql .= ' --tablespace-slim-index ssd --tablespace-main-index ssd --tablespace-main-data ssd --tablespace-slim-data data';
                $osm2pgsql .= ' -lsc -O gazetteer --hstore';
                $osm2pgsql .= ' -C 16000';
+               $osm2pgsql .= ' -P '.$aDSNInfo['port'];
                $osm2pgsql .= ' -d '.$aDSNInfo['database'].' '.$aCMDResult['osm-file'];
                passthruCheckReturn($osm2pgsql);
 
                $bDidSomething = true;
                $sOutputFile = '';
                if (isset($aCMDResult['index-output'])) $sOutputFile = ' -F '.$aCMDResult['index-output'];
-               $sBaseCmd = CONST_BasePath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -t '.$iInstances.$sOutputFile;
+               $sBaseCmd = CONST_BasePath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port'].' -t '.$iInstances.$sOutputFile;
                passthruCheckReturn($sBaseCmd.' -R 4');
                if (!$aCMDResult['index-noanalyse']) pgsqlRunScript('ANALYSE');
                passthruCheckReturn($sBaseCmd.' -r 5 -R 25');