X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/832547f192904a9ec92e173c27a91e0874fcc757..9905bbf733542af5f0ac1e3d827fbb353b446beb:/utils/query.php diff --git a/utils/query.php b/utils/query.php old mode 100755 new mode 100644 index 06d7f13b..f8047ffc --- a/utils/query.php +++ b/utils/query.php @@ -1,39 +1,39 @@ -#!/usr/bin/php -Cq connect(); -if ($oParams->getBool('search')) -{ +$oParams = new Nominatim\ParameterParser($aCMDResult); + +if ($oParams->getBool('search')) { if (isset($aCMDResult['nodedupe'])) $aCMDResult['dedupe'] = 'false'; - $oGeocode = new Geocode($oDB); + $oGeocode = new Nominatim\Geocode($oDB); $oGeocode->setLanguagePreference($oParams->getPreferredLanguages(false)); $oGeocode->loadParamArray($oParams); @@ -41,12 +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"; -} -else -{ + echo json_encode($aSearchResults, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)."\n"; +} else { showUsage($aCMDOptions, true); }