add namespaces, method visibility according to PSR2 standard

This commit is contained in:
Marc Tobias Metten
2016-09-16 02:27:36 +02:00
parent e1be3d9f48
commit 6238ae6032
12 changed files with 86 additions and 77 deletions

View File

@@ -7,7 +7,7 @@ require_once(CONST_BasePath.'/lib/log.php');
require_once(CONST_BasePath.'/lib/output.php');
ini_set('memory_limit', '200M');
$oParams = new ParameterParser();
$oParams = new Nominatim\ParameterParser();
$sOutputFormat = 'html';
$aLangPrefOrder = $oParams->getPreferredLanguages();

View File

@@ -8,7 +8,7 @@ require_once(CONST_BasePath.'/lib/PlaceLookup.php');
require_once(CONST_BasePath.'/lib/output.php');
ini_set('memory_limit', '200M');
$oParams = new ParameterParser();
$oParams = new Nominatim\ParameterParser();
$sOutputFormat = $oParams->getSet('format', array('html', 'json'), 'html');
$aLangPrefOrder = $oParams->getPreferredLanguages();
@@ -51,7 +51,7 @@ if (CONST_Use_Aux_Location_data) {
if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
}
$oPlaceLookup = new PlaceLookup($oDB);
$oPlaceLookup = new Nominatim\PlaceLookup($oDB);
$oPlaceLookup->setLanguagePreference($aLangPrefOrder);
$oPlaceLookup->setIncludeAddressDetails(true);

View File

@@ -8,7 +8,7 @@ require_once(CONST_BasePath.'/lib/PlaceLookup.php');
require_once(CONST_BasePath.'/lib/output.php');
ini_set('memory_limit', '200M');
$oParams = new ParameterParser();
$oParams = new Nominatim\ParameterParser();
// Format for output
$sOutputFormat = $oParams->getSet('format', array('xml', 'json'), 'xml');
@@ -23,7 +23,7 @@ $hLog = logStart($oDB, 'place', $_SERVER['QUERY_STRING'], $aLangPrefOrder);
$aSearchResults = array();
$aCleanedQueryParts = array();
$oPlaceLookup = new PlaceLookup($oDB);
$oPlaceLookup = new Nominatim\PlaceLookup($oDB);
$oPlaceLookup->setLanguagePreference($aLangPrefOrder);
$oPlaceLookup->setIncludeAddressDetails($oParams->getBool('addressdetails', true));
$oPlaceLookup->setIncludeExtraTags($oParams->getBool('extratags', false));

View File

@@ -6,7 +6,7 @@ require_once(CONST_BasePath.'/lib/log.php');
require_once(CONST_BasePath.'/lib/output.php');
ini_set('memory_limit', '200M');
$oParams = new ParameterParser();
$oParams = new Nominatim\ParameterParser();
$sOutputFormat = 'html';
$iDays = $oParams->getInt('days', 1);

View File

@@ -9,7 +9,7 @@ require_once(CONST_BasePath.'/lib/ReverseGeocode.php');
require_once(CONST_BasePath.'/lib/output.php');
ini_set('memory_limit', '200M');
$oParams = new ParameterParser();
$oParams = new Nominatim\ParameterParser();
$bAsGeoJSON = $oParams->getBool('polygon_geojson');
$bAsKML = $oParams->getBool('polygon_kml');
@@ -39,7 +39,7 @@ $oDB =& getDB();
$hLog = logStart($oDB, 'reverse', $_SERVER['QUERY_STRING'], $aLangPrefOrder);
$oPlaceLookup = new PlaceLookup($oDB);
$oPlaceLookup = new Nominatim\PlaceLookup($oDB);
$oPlaceLookup->setLanguagePreference($aLangPrefOrder);
$oPlaceLookup->setIncludeAddressDetails($oParams->getBool('addressdetails', true));
$oPlaceLookup->setIncludeExtraTags($oParams->getBool('extratags', false));
@@ -52,7 +52,7 @@ $fLon = $oParams->getFloat('lon');
if ($sOsmType && $iOsmId > 0) {
$aPlace = $oPlaceLookup->lookupOSMID($sOsmType, $iOsmId);
} elseif ($fLat !== false && $fLon !== false) {
$oReverseGeocode = new ReverseGeocode($oDB);
$oReverseGeocode = new Nominatim\ReverseGeocode($oDB);
$oReverseGeocode->setZoom($oParams->getInt('zoom', 18));
$aLookup = $oReverseGeocode->lookup($fLat, $fLon);

View File

@@ -9,9 +9,9 @@ require_once(CONST_BasePath.'/lib/output.php');
ini_set('memory_limit', '200M');
$oDB =& getDB();
$oParams = new ParameterParser();
$oParams = new Nominatim\ParameterParser();
$oGeocode = new Geocode($oDB);
$oGeocode = new Nominatim\Geocode($oDB);
$aLangPrefOrder = $oParams->getPreferredLanguages();
$oGeocode->setLanguagePreference($aLangPrefOrder);
@@ -64,7 +64,7 @@ if (CONST_Search_BatchMode && isset($_GET['batch'])) {
$aBatchResults = array();
foreach ($aBatch as $aBatchParams) {
$oBatchGeocode = clone $oGeocode;
$oBatchParams = new ParameterParser($aBatchParams);
$oBatchParams = new Nominatim\ParameterParser($aBatchParams);
$oBatchGeocode->loadParamArray($oBatchParams);
$oBatchGeocode->setQueryFromParams($oBatchParams);
$aSearchResults = $oBatchGeocode->lookup();