X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/effd8e12af440586594a18a04beb33abed260d15..1526501ed7786fd0c7e63c570fae125f960a3571:/utils/query.php?ds=sidebyside diff --git a/utils/query.php b/utils/query.php index 06d7f13b..e3e2e7b8 100755 --- a/utils/query.php +++ b/utils/query.php @@ -1,4 +1,4 @@ -#!/usr/bin/php -Cq +#!@PHP_BIN@ -Cq getBool('search')) -{ +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,11 @@ if ($oParams->getBool('search')) $aSearchResults = $oGeocode->lookup(); - if (version_compare(phpversion(), "5.4.0", '<')) + if (version_compare(phpversion(), '5.4.0', '<')) { echo json_encode($aSearchResults); - else + } else { echo json_encode($aSearchResults, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)."\n"; -} -else -{ + } +} else { showUsage($aCMDOptions, true); }