2017 © Pedro Peláez
 

yii2-extension yii2-geoip-city-db

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

image

dpodium/yii2-geoip-city-db

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

  • Thursday, July 5, 2018
  • by dpodium
  • Repository
  • 3 Watchers
  • 0 Stars
  • 23 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Yii2 GeoIP - City DB version

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-city-db "~0.2"

or add, (*5)

"dpodium/yii2-geoip-city-db "~0.2"

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

Component Setup

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

return [
    'components' => [
    ...
        'geoip' => [
                   'class' => 'dpodium\yii2\geoip\components\CGeoIP',
               ],
        ...
    ],
    ...
];

If querying only partial Country data is required, yii2-geoip can be used instead and is lighter in terms of repo size, see dpodium/yii2-geoip., (*8)

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

Usage

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

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

Location attributes:, (*11)

$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

0.3

0.3.0.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

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

12/06 2018

0.2

0.2.0.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

0.1

0.1.0.0

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

  Sources   Download

MIT

The Requires

 

geoip extension yii2 maxmind