]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/polygons.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / website / polygons.php
index c5fbafc22a44f635ccee70131561db5cbc783b4b..88b48ae8e4c22c6d915a76df3299f9fbd3c162e6 100644 (file)
@@ -1,19 +1,19 @@
 <?php
 
-require_once(CONST_BasePath.'/lib/init-website.php');
-require_once(CONST_BasePath.'/lib/log.php');
-require_once(CONST_BasePath.'/lib/output.php');
+require_once(CONST_LibDir.'/init-website.php');
+require_once(CONST_LibDir.'/log.php');
+require_once(CONST_LibDir.'/output.php');
 ini_set('memory_limit', '200M');
 
 $oParams = new Nominatim\ParameterParser();
-$sOutputFormat = $oParams->getSet('format', array('html', 'json'), 'html');
+$sOutputFormat = $oParams->getSet('format', array('json'), 'json');
 set_exception_handler_by_format($sOutputFormat);
 
 $iDays = $oParams->getInt('days', false);
 $bReduced = $oParams->getBool('reduced', false);
 $sClass = $oParams->getString('class', false);
 
-$oDB = new Nominatim\DB();
+$oDB = new Nominatim\DB(CONST_Database_DSN);
 $oDB->connect();
 
 $iTotalBroken = (int) $oDB->getOne('SELECT count(*) FROM import_polygon_error');
@@ -47,7 +47,5 @@ if (CONST_Debug) {
 }
 
 if ($sOutputFormat == 'json') {
-    echo javascript_renderData($aPolygons);
-} else {
-    include(CONST_BasePath.'/lib/template/polygons-html.php');
+    javascript_renderData($aPolygons);
 }