replace database abstraction DB with PDO

This commit is contained in:
marc tobias
2019-02-24 16:14:36 +01:00
parent b20a534e0c
commit d4b633bfc5
42 changed files with 499 additions and 255 deletions

View File

@@ -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;
}