From e42ff1935f05c6e0eb5db77d264e7c923186deb2 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 3 Mar 2014 21:48:17 +0100 Subject: [PATCH] forgot the actual query script --- lib/init-cmd.php | 1 - utils/query.php | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100755 utils/query.php diff --git a/lib/init-cmd.php b/lib/init-cmd.php index c36f0e57..e6de0522 100644 --- a/lib/init-cmd.php +++ b/lib/init-cmd.php @@ -1,7 +1,6 @@ setLanguagePreference(getPreferredLanguages($aCMDResult['accept-language'])); + else + $oGeocode->setLanguagePreference(getPreferredLanguages()); + $oGeocode->loadParamArray($aCMDResult); + $oGeocode->setQuery($aCMDResult['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 + { + showUsage($aCMDOptions, true); + } + + + -- 2.39.5