2017 © Pedro Peláez
 

yii2-extension yii2-geo

Yii GEO helper/finder

image

yiicod/yii2-geo

Yii GEO helper/finder

  • Tuesday, July 24, 2018
  • by lexxorlov
  • Repository
  • 1 Watchers
  • 6 Stars
  • 481 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 41 % Grown

The README.md

Yii Geo position getter extension

Latest Stable Version Total Downloads Scrutinizer Code QualityCode Climate, (*1)

This extension will help you to find user country and country code. It use two online and one offline system for find information about user. You no need worry what system will use because all of this will do one component GeoFinder, (*2)

Installation

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

Either run, (*4)

php composer.phar require --prefer-dist yiicod/yii2-geo "*"

or add, (*5)

"yiicod/yii2-geo": "*"

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

Config for frontend

'container' => [
    'singletons' => [
        \yiicod\geo\storages\StorageInterface::class => [
            'class' => \yiicod\geo\storages\CacheStorage::class,
        ],
    ],
],
'components' => [
    'geoFinder' => [
        'class' => yiicod\geo\components\GeoFinder::class,
        'gettersList' => [
            [
                'class' => \yiicod\geo\adapters\geoIp2\GeoIp2CityAdapter::class,
                'databaseConfig' => [
                    'class' => \yiicod\geo\adapters\geoIp2\GeoIp2Database::class,
                    'databaseAlias' => '@frontend/runtime',
                ],
            ],
            [
                'class' => \yiicod\geo\adapters\ipstack\IpstackAdapter::class,
                'apiKey' => 'API-key'
            ],
            [
                'class' => \yiicod\geo\adapters\geoPlugin\GeoPluginAdapter::class,
            ],
        ],
    ],
],

Usage

```php \yiicod\geo\GeoGetter::getCountryName($ip) \yiicod\geo\GeoGetter::getCountryCode($ip) \yiicod\geo\GeoGetter::getRegionName($ip), \yiicod\geo\GeoGetter::getRegionCode($ip), \yiicod\geo\GeoGetter::getCity($ip), \yiicod\geo\GeoGetter::getLatitude($ip), \yiicod\geo\GeoGetter::getLongitude($ip), ````, (*7)

The Versions

24/07 2018

dev-master

9999999-dev

Yii GEO helper/finder

  Sources   Download

MIT New BSD License

The Requires

 

The Development Requires

by Dmitriy Turchanin

24/07 2018

1.1.0

1.1.0.0

Yii GEO helper/finder

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitriy Turchanin

18/02 2018

1.0.1

1.0.1.0

Yii GEO helper/finder

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitriy Turchanin

13/09 2017

1.0.0

1.0.0.0

  Sources   Download

New BSD License

The Requires

 

by Dmitriy Turchanin