]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/db.php
Make deduplicate work again. Only currently support 9.3 due to new postgresql functi...
[nominatim.git] / lib / db.php
index a2bba81f587be2d40260efa45d8c2c154d04d23f..b6dc89c49157ddd16072a829221f5d6193c9ef5b 100644 (file)
@@ -1,13 +1,15 @@
 <?php
        require_once('DB.php');
 
-       function &getDB()
+       function &getDB($bNew = false, $bPersistent = false)
        {
                // Get the database object
-               $oDB =& DB::connect(CONST_Database_DSN, false);
+               $oDB =& DB::connect(CONST_Database_DSN.($bNew?'?new_link=true':''), $bPersistent);
                if (PEAR::IsError($oDB))
                {
-                       fail($oDB->getMessage(), 'Unable to connect to the database');
+                       var_dump(CONST_Database_DSN);
+                       var_Dump($oDB);
+                       fail($oDB->getMessage());
                }
                $oDB->setFetchMode(DB_FETCHMODE_ASSOC);
                $oDB->query("SET DateStyle TO 'sql,european'");