51degrees / fiftyone.geolocation
Geolocation engines for 51Degrees Pipeline API. Perform reverse geocoding using longitude and latitude to populate postal addresses.
Requires
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.39
- phpstan/phpstan: ^1.10
- phpunit/phpunit: *
- dev-main
- 4.5.3.0
- 4.5.2.0
- 4.5.1.0
- 4.5.0.0
- 4.4.27.0
- 4.4.26.0
- 4.4.25.0
- 4.4.24.0
- 4.4.23.0
- 4.4.22.0
- 4.4.21.0
- 4.4.20.0
- 4.4.19.0
- 4.4.18.0
- 4.4.17.0
- 4.4.16.0
- 4.4.15.0
- 4.4.14.0
- 4.4.13.0
- 4.4.12.0
- 4.4.11.0
- 4.4.10.0
- 4.4.9.0
- 4.4.8.0
- 4.4.7.0
- 4.4.6.0
- 4.4.5.0
- 4.4.4.0
- 4.4.3.0
- 4.4.2.0
- 4.4.1
- 4.4.0
- 4.3.5
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.2+4
- 4.2.1+4
- 4.2.0
- 4.1.1+2
- 4.1.0
- 4.1.0-beta.3+2
- dev-copyright-update
This package is auto-updated.
Last update: 2024-11-16 20:47:20 UTC
README
Introduction
This repository contains the geo-location engines for the PHP implementation of the Pipeline API.
Pre-requesites
The Pipeline engines are written in PHP and target 5 and 7.
Packages
- geoLocation - A Node.js engine which retrieves geo-location results by consuming data from the 51Degrees cloud service.
- geoLocationPipelineBuilder - Contains the geo-location engine builders.
Installation
You can either reference the projects in this repository or you can reference the Composer packages in your project:
"require": {
"51degrees/fiftyone.geolocation": "@dev",
...
Make sure to select the latest version from Composer.
Configuration Options
- String
type
- The name of the type of geolocation service to use. - String
resourceKey
- Resource Key is evidence used within the Cloud service for monitoring usage. Obtain a resource key. - Array
restrictedProperties
- The properties to populate values for in the result (all are populated by default).
Examples
Examples can be found in the examples
folder. See below for a list of examples.
Ensure the resource_key
environment variable is set to your resource key prior to running the example scripts.
To run the examples, go to the examples
directory and run:
php -S localhost:8080
The examples will now be available to view in a browser. For example, the cloud getting started example will be available
by browsing to localhost:8080/cloud/gettingstarted.php
.
Tests
In this repository, there are tests using phpunit. You will need to install the package dependencies to run them:
composer install
To run the tests, then call:
phpunit --fail-on-warning --display-warnings --log-junit test-results.xml
Project documentation
For complete documentation on the Pipeline API and associated engines, see the 51Degrees documentation site.