X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ac116980ac78b74dbc1e0ae7ff2d329d7e581ba5..504922ffbecd42eed01dfb9da6bbf2c7aae9a094:/lib/cmd.php diff --git a/lib/cmd.php b/lib/cmd.php index b72c1bb4..5a12f99a 100644 --- a/lib/cmd.php +++ b/lib/cmd.php @@ -147,7 +147,7 @@ function repeatWarnings() function runSQLScript($sScript, $bfatal = true, $bVerbose = false, $bIgnoreErrors = false) { // Convert database DSN to psql parameters - $aDSNInfo = \Nominatim\DB::parseDSN(CONST_Database_DSN); + $aDSNInfo = \Nominatim\DB::parseDSN(getSetting('DATABASE_DSN')); if (!isset($aDSNInfo['port']) || !$aDSNInfo['port']) $aDSNInfo['port'] = 5432; $oCmd = new \Nominatim\Shell('psql'); @@ -198,19 +198,18 @@ function runSQLScript($sScript, $bfatal = true, $bVerbose = false, $bIgnoreError function setupHTTPProxy() { - if (!CONST_HTTP_Proxy) { + if (!getSettingBool('HTTP_PROXY')) { return; } - $sProxy = 'tcp://'.CONST_HTTP_Proxy_Host.':'.CONST_HTTP_Proxy_Port; + $sProxy = 'tcp://'.getSetting('HTTP_PROXY_HOST').':'.getSetting('HTTP_PROXY_PROT'); $aHeaders = array(); - if (CONST_HTTP_Proxy_Login != null - && CONST_HTTP_Proxy_Login != '' - && CONST_HTTP_Proxy_Password != null - && CONST_HTTP_Proxy_Password != '' - ) { - $sAuth = base64_encode(CONST_HTTP_Proxy_Login.':'.CONST_HTTP_Proxy_Password); + $sLogin = getSetting('HTTP_PROXY_LOGIN'); + $sPassword = getSetting('HTTP_PROXY_PASSWORD'); + + if ($sLogin && $sPassword) { + $sAuth = base64_encode($sLogin.':'.$sPassword); $aHeaders = array('Proxy-Authorization: Basic '.$sAuth); }