2017 © Pedro Peláez
 

yii2-extension yii2-geoip

GeoIP helper for Yii2

image

rmrevin/yii2-geoip

GeoIP helper for Yii2

  • Friday, May 27, 2016
  • by rmrevin
  • Repository
  • 6 Watchers
  • 27 Stars
  • 2,312 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 11 Versions
  • 4 % Grown

The README.md

GeoIP helper for Yii2

DEPRECATED

This package is no longer supported because MaxMind no longer supports the correct version of the database. Use official package geoip2/geoip2., (*1)

Installation

Install php5-geoip extension., (*2)

Add in composer.json:, (*3)

{
    "require": {
        "rmrevin/yii2-geoip": "~1.1"
    }
}

Usage

In view, (*4)

<?
// ...

/** @var \rmrevin\yii\geoip\HostInfo $Info */
$Info = \Yii::createObject([
    'class' => '\rmrevin\yii\geoip\HostInfo',
    'host' => 'phptime.ru', // some host or ip
]);

// check available
$Info->isAvailable();

// obtaining all data
$Info->getData();

// obtaining the individual parameters
$Info->getContinentCode(); // NA
$Info->getCountryCode();   // US
$Info->getCountryCode3();  // USA
$Info->getCountryName();   // United States
$Info->getRegion();        // MI
$Info->getRegionName();    // Michigan
$Info->getCity();          // Southfield
$Info->getPostalCode();    // 48075
$Info->getLatitude();      // 42.465000152588
$Info->getLongitude();     // -83.230697631836
$Info->getDmaCode();       // 505
$Info->getAreaCode();      // 248
$Info->getTimeZone();      // America/New_York

FAQ

Q: I get error Required database not available at /usr/share/GeoIP/GeoIPCity.dat.. What to do?, (*5)

A: Download this file (this file is no more available) http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz and ungzip it into /usr/share/GeoIP/GeoIPCity.dat, (*6)

The Versions

27/05 2016

dev-master

9999999-dev

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

27/05 2016

1.1.0

1.1.0.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

08/02 2015

1.0.8

1.0.8.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

08/02 2015

1.0.7

1.0.7.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

08/02 2015

1.0.6

1.0.6.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

08/02 2015

1.0.5

1.0.5.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

08/10 2014

1.0.4

1.0.4.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

08/10 2014

1.0.3

1.0.3.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

08/10 2014

1.0.2

1.0.2.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

07/10 2014

1.0.1

1.0.1.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip

07/10 2014

1.0.0

1.0.0.0

GeoIP helper for Yii2

  Sources   Download

MIT

The Requires

 

geoip helper geo yii ip