2017 © Pedro Peláez
 

yii2-extension yii2-geoip

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

image

dpodium/yii2-geoip

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  • Thursday, July 5, 2018
  • by dpodium
  • Repository
  • 4 Watchers
  • 2 Stars
  • 2,975 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 20 Versions
  • 8 % Grown

The README.md

Yii2 GeoIP

Yii2 Component to allow for easy usage of the MaxMind Free dbs., (*1)

Based on package phiphi1992/Yii2-GeoIP by Phi Hoang Xuan., (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require dpodium/yii2-geoip "~2.0.0"

or add, (*5)

"dpodium/yii2-geoip": "~2.0.0"

to the require section of your composer.json file., (*6)

Version ~2.0.0 Difference

Version ~2.0.0 uses the new GeoLite2 version of the db instead of the Legacy GeoLite which is now deprecated., (*7)

Database can be found here: https://dev.maxmind.com/geoip/geoip2/geolite2/, (*8)

Component Setup

Once the extension is installed, simply modify your application configuration as follows:, (*9)

return [
    'components' => [
    ...
        'geoip' => [
            'class' => 'dpodium\yii2\geoip\components\CGeoIP',
            'support_ipv6' => false, //Default value
        ],
        ...
    ],
    ...
];

If querying full City data is required, yii2-geoip-city-db must be required as well, see dpodium/yii2-geoip-city-db., (*10)

For more information on the data availability, see below., (*11)

Usage

All methods accept an IP address as an argument. If no argument is supplied Yii::$app->getRequest()->getUserIP() is used., (*12)

//Along with free DB
$location = Yii::$app->geoip->lookupLocation();
$countryCode = Yii::$app->geoip->lookupCountryCode();
$countryName = Yii::$app->geoip->lookupCountryName();

Location attributes:, (*13)

$location->countryCode //Available in both Country and City DB
$location->countryName //Available in both Country and City DB
$location->continentCode //Available in both Country and City DB
$location->continentName //Available in both Country and City DB
$location->city //Available in only City DB
$location->postalCode //Available in only City DB
$location->latitude //Available in only City DB
$location->longitude //Available in only City DB
$location->timeZone //Available in only City DB

The Versions

05/07 2018

dev-master

9999999-dev

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

05/07 2018

2.0.4

2.0.4.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

18/06 2018

2.0.3

2.0.3.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

12/06 2018

2.0.2

2.0.2.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

12/06 2018

2.0.1

2.0.1.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

12/06 2018

2.0.0

2.0.0.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

04/01 2018

1.3.9

1.3.9.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

08/12 2017

1.3.8

1.3.8.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

24/10 2017

1.3.7

1.3.7.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

11/10 2017

1.3.6

1.3.6.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

04/07 2017

1.3.5

1.3.5.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

20/06 2017

1.3.4

1.3.4.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

28/12 2016

1.3.3

1.3.3.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

27/12 2016

1.3.2

1.3.2.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

07/12 2015

1.3.1

1.3.1.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

07/12 2015

1.3

1.3.0.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

23/11 2015

1.2

1.2.0.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

16/11 2015

1.1

1.1.0.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

13/11 2015

1.0.1

1.0.1.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind

13/11 2015

1.0

1.0.0.0

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind