]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/lookup.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / website / lookup.php
old mode 100755 (executable)
new mode 100644 (file)
index f09506a..20d06af
@@ -1,7 +1,5 @@
 <?php
-@define('CONST_ConnectionBucket_PageType', 'Reverse');
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/PlaceLookup.php');
@@ -12,11 +10,13 @@ $oParams = new Nominatim\ParameterParser();
 
 // Format for output
 $sOutputFormat = $oParams->getSet('format', array('xml', 'json', 'geojson'), 'xml');
+set_exception_handler_by_format($sOutputFormat);
 
 // Preferred language
 $aLangPrefOrder = $oParams->getPreferredLanguages();
 
-$oDB =& getDB();
+$oDB = new Nominatim\DB();
+$oDB->connect();
 
 $hLog = logStart($oDB, 'place', $_SERVER['QUERY_STRING'], $aLangPrefOrder);