Download the PHP package jroedel/zf-snap-geoip without Composer
On this page you can find all versions of the php package jroedel/zf-snap-geoip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package zf-snap-geoip
ZfSnapGeoip
Maxmind Geoip module for Zend Framework 2
Created by Witold Wasiczko
Usage
Default ZfSnapGeoip returns Record object created by current user's IP address.
In controller:
By view helper:
Returns city name for current IP:
Returns country name for given IP:
You can also implements \ZfSnapGeoip\IpAwareInterface
interface and then use instance in service/helper:
Avaliable getter methods via \ZfSnapGeoip\Entity\Record
:
Events
Module supports \Zend\EventManager
.
Class | Event name | Description | Params |
---|---|---|---|
ZfSnapGeoip\Controller\ConsoleController | downloadAction.exists | If no-clobber is enabled and file exists | path (to dat file) |
ZfSnapGeoip\Controller\ConsoleController | downloadAction.pre | Before unzip file | path (to dat file), response (gziped response object) |
ZfSnapGeoip\Controller\ConsoleController | downloadAction.post | After unzip file | path (to dat file) |
ZfSnapGeoip\Service\Geoip | getIp | After read IP | ip (ip address) |
ZfSnapGeoip\Service\Geoip | getRecord | After created record | record (instance of ZfSnapGeoip\Entity\RecordInterface) |
ZfSnapGeoip\Service\Geoip | getRegions | After first loading regions names | regions |
How to install?
Via composer.json
and add ZfSnapGeoip
module name to application.config.php
To download data file from http://dev.maxmind.com/geoip/legacy/geolite/ use Zend\Console
(you can add this to crontab):
Or use autoupdate database during install/update in composer (just add this lines to composer.json and run composer):
Console usage
You can download GeoIP database from application console:
There are optional parameters:
--no-clobber
Don't overwrite an existing db file,-q
Turn off output,
All versions of zf-snap-geoip with dependencies
geoip/geoip Version ^1.17
zendframework/zend-mvc Version ^3.0
zendframework/zend-modulemanager Version ^2.7
zendframework/zend-servicemanager Version ^3.3
zendframework/zend-eventmanager Version ^3.1
zendframework/zend-console Version ^2.6
zendframework/zend-view Version ^2.8
zendframework/zend-hydrator Version ^2.2
zendframework/zend-filter Version ^2.7