]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/lookup.php
Revert layout changes in list.
[nominatim.git] / website / lookup.php
old mode 100755 (executable)
new mode 100644 (file)
index 695a083..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);
 
@@ -25,6 +25,7 @@ $aCleanedQueryParts = array();
 
 $oPlaceLookup = new Nominatim\PlaceLookup($oDB);
 $oPlaceLookup->loadParamArray($oParams);
+$oPlaceLookup->setIncludeAddressDetails($oParams->getBool('addressdetails', true));
 
 $aOsmIds = explode(',', $oParams->getString('osm_ids', ''));