X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/f45b3fa3f243de8894c03d8c9377157d01092c8c..d4b633bfc50188f36e3c4a8b2b99c3a0e6a7f12e:/lib/setup_functions.php diff --git a/lib/setup_functions.php b/lib/setup_functions.php index b1417678..89736ae0 100755 --- a/lib/setup_functions.php +++ b/lib/setup_functions.php @@ -24,15 +24,17 @@ function checkModulePresence() $sSQL .= $sModulePath . "/nominatim.so', 'transliteration' LANGUAGE c IMMUTABLE STRICT"; $sSQL .= ';DROP FUNCTION nominatim_test_import_func(text);'; - $oDB = &getDB(); - $oResult = $oDB->query($sSQL); + $oDB = new \Nominatim\DB(); + $oDB->connect(); $bResult = true; - - if (PEAR::isError($oResult)) { + try { + $oDB->exec($sSQL); + } catch (\Nominatim\DatabaseError $e) { echo "\nERROR: Failed to load nominatim module. Reason:\n"; - echo $oResult->userinfo . "\n\n"; + echo $oDB->getLastError()[2] . "\n\n"; $bResult = false; } + return $bResult; }