Download the PHP package formatd/geoip without Composer

On this page you can find all versions of the php package formatd/geoip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package geoip

FormatD.GeoIP

A Neos CMS Integration for the geolocation service geoip2 api client of Maxmind (maxmind.com).

What does it do?

This package provides a service-class and eel-helper to access the geo-information of a user (by analyzing the IP address with the maxmind api). Optionally you can integrate a prompt to redirect the user to the content dimension matching his current location.

Compatibility

Versioning scheme:

 1.0.0 
 | | |
 | | Bugfix Releases (non breaking)
 | Neos Compatibility Releases (non breaking except framework dependencies)
 Feature Releases (breaking)

Releases und compatibility:

Package-Version Neos CMS Version
1.0.x 4.x
1.1.x 5.x
1.2.x 7.x, 8.x

Using the service in you own plugins

Inject the IPLocalizationService into your class and call the method according to the maxmind endpoint (getCountry, getCity, getInsights). the corresponding model of the geoip2 library holding all available information is returned.

Using the service in fusion

To get de country iso code in lowercase call this eel-helper.

The eel-helper accepts an optional argument "key" (e.g. "continent.code") for direct access to the data provided by geoip2

Using the dimension switch prompt

To display a layer on your site telling the user to switch dimension if he is located somewhere else integrate this fusion prototype and place it where you need it.

  1. Place fusion prototype where you want it in your site

  2. Integrate LocationBasedDimensionSwitchPrompt.js into your site js bundling (it requires jQuery)

  3. Configure the mapping (which iso code to what dimension value) in the Settings.yaml (see configuration)

  4. Make it pretty with css

Configuration options

Set your maxmind credentials in the Settings.yaml

For local testing you can enable debugging and simulate your ip address

To make the LocationBasedDimensionSwitchPrompt work you have to configure which iso code you want to redirect to which dimension value.

Calls to the API are cached for one day. You can modify the default lifetime in your Caches.yaml


All versions of geoip with dependencies

PHP Build Version
Package Version
Requires neos/neos Version ^7.0 || ^8.0
geoip2/geoip2 Version ~2.13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package formatd/geoip contains the following files

Loading the files please wait ....