X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/e70f405abddfe5a8a7400424558071ebba769eda..586ff0c3648b530597c29ee3e555432e514883d1:/utils/query.php diff --git a/utils/query.php b/utils/query.php index 16657daf..f8047ffc 100644 --- a/utils/query.php +++ b/utils/query.php @@ -25,7 +25,9 @@ $aCMDOptions ); getCmdOpt($_SERVER['argv'], $aCMDOptions, $aCMDResult, true, true); -$oDB =& getDB(); +$oDB = new Nominatim\DB; +$oDB->connect(); + $oParams = new Nominatim\ParameterParser($aCMDResult); if ($oParams->getBool('search')) { @@ -39,11 +41,7 @@ if ($oParams->getBool('search')) { $aSearchResults = $oGeocode->lookup(); - if (version_compare(phpversion(), '5.4.0', '<')) { - echo json_encode($aSearchResults); - } else { - echo json_encode($aSearchResults, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)."\n"; - } + echo json_encode($aSearchResults, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)."\n"; } else { showUsage($aCMDOptions, true); }