Download the PHP package netglue/geoip2-helpers without Composer

On this page you can find all versions of the php package netglue/geoip2-helpers. 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 geoip2-helpers

Geo Location Helper/Middleware for Zend Framework/Expressive Projects

Latest Stable Version Coverage Status Build Status Maintainability Test Coverage

About

This lib is useful if you are only interested in using MaxMind’s GeoLite2 databases to figure out the country of origin and maybe a bit more detail such as city (slower) based on the IP address of the visitor inside a Zend Expressive or PSR-15 app, or a Zend Framework 3 based app. Factories and default configuration are setup out of the box for both Expressive and ZF3.

Retrieving location data for an IP address relies on the ability to figure out the remote address of the client, so this lib has a dependency on netglue/realip-helpers. This is only used by the middleware.

Install

Install with composer using "netglue/geoip2-helpers"

Zend’s component installer

Get a copy of the database

This package comes with a utility for downloading the free, GeoLite2 databases. If you are using a paid version, you’ll probably be downloading the databases into a central location, so MaxMind’s geoipupdate will likely be a better tool for you: https://github.com/maxmind/geoipupdate.

Using the shipped downloader tool

After installing with composer, the command will be made available in vendor/bin/geoip. You can get help for the command with geoip help geoip:download.

With no arguments, the command will download both the city and country databases into the ./data directory of this lib. To download to a different directory, you should provide a directory argument, i.e geoip geoip:download ~/geoip-data/here.

Files will be named whatever they are on the remote server, something like GeoLite2-City.mmdb.

If you are only interested in Country level information, you can turn off downloading the city database with the --country switch and vice-versa with --city. By default, both databases will be retrieved.

The --no-clobber switch will only perform a download if the files do not already exist so it can be used during deployment for example to avoid repeatedly downloading stuff you don't need.

ZF3 Controller Plugin

In a ZF3 app, the default config exposes a plugin with the name geoIp. Using this plugin is pretty straight forward:

PSR-15 Middleware

Add \NetglueGeoIP\Middleware\Geolocation::class to your pipeline, after a middleware that will inject a request attribute of ip_address (By default, can be configured in construct) containing the client IP.

Subsequent middleware will have access to the attributes:

Alternative stuff to look at

This lib might be too narrow or specific so you might find that Geocoder PHP is a more mature, better fit for your needs. There's PSR-15 middleware out there that consumes this lib: middlewares/geolocation

Test

cd to wherever the module is installed, issue a composer install followed by a composer test.

Contributions

PR's are welcomed. Please write tests for new features.

Support

You're welcome to file issues, but please understand that finding the time to answer support requests is very limited so there might be a long wait for an answer.

About

Netglue makes websites and apps in Devon, England. We hope this is useful to you and we’d appreciate feedback either way :)


All versions of geoip2-helpers with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-zlib Version *
ext-json Version *
maxmind-db/reader Version ^1
psr/container Version ^1.0
symfony/console Version ^4.1
zendframework/zend-http Version ^2
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
netglue/realip-helpers Version ^1.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 netglue/geoip2-helpers contains the following files

Loading the files please wait ....