X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/1ee636461c3fe1925731691985161a19cea64247..1560685020f7c19eeee6d28b12a863cd0c6b6592:/lib/cmd.php?ds=sidebyside diff --git a/lib/cmd.php b/lib/cmd.php index 10186810..32fdc857 100644 --- a/lib/cmd.php +++ b/lib/cmd.php @@ -120,15 +120,6 @@ function showUsage($aSpec, $bExit = false, $sError = false) exit; } -function chksql($oSql, $sMsg = false) -{ - if (PEAR::isError($oSql)) { - fail($sMsg || $oSql->getMessage(), $oSql->userinfo); - } - - return $oSql; -} - function info($sMsg) { echo date('Y-m-d H:i:s == ').$sMsg."\n"; @@ -155,7 +146,7 @@ function repeatWarnings() function runSQLScript($sScript, $bfatal = true, $bVerbose = false, $bIgnoreErrors = false) { // Convert database DSN to psql parameters - $aDSNInfo = DB::parseDSN(CONST_Database_DSN); + $aDSNInfo = \Nominatim\DB::parseDSN(CONST_Database_DSN); if (!isset($aDSNInfo['port']) || !$aDSNInfo['port']) $aDSNInfo['port'] = 5432; $sCMD = 'psql -p '.$aDSNInfo['port'].' -d '.$aDSNInfo['database']; if (isset($aDSNInfo['hostspec']) && $aDSNInfo['hostspec']) { @@ -186,7 +177,7 @@ function runSQLScript($sScript, $bfatal = true, $bVerbose = false, $bIgnoreError } if (!$bVerbose) { - fwrite($ahPipes[0], "set client_min_messages to WARNING;"); + fwrite($ahPipes[0], 'set client_min_messages to WARNING;'); } while (strlen($sScript)) {