PHPackages                             yiicod/yii2-geo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yiicod/yii2-geo

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

yiicod/yii2-geo
===============

Yii GEO helper/finder

1.1.0(7y ago)61.2kMITPHP

Since Sep 13Pushed 7y ago1 watchersCompare

[ Source](https://github.com/yiicod/yii2-geo)[ Packagist](https://packagist.org/packages/yiicod/yii2-geo)[ RSS](/packages/yiicod-yii2-geo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

Yii Geo position getter extension
=================================

[](#yii-geo-position-getter-extension)

[![Latest Stable Version](https://camo.githubusercontent.com/1f726ed8eedee408989bff476b1ee197e3aa5835ec7a07f8264ca74484c2ba16/68747470733a2f2f706f7365722e707567782e6f72672f796969636f642f796969322d67656f2f762f737461626c65)](https://packagist.org/packages/yiicod/yii2-geo) [![Total Downloads](https://camo.githubusercontent.com/961dc9f1bb76046286189125c2acaa0c19a6b560aaae99f7e88e516c3e38d1df/68747470733a2f2f706f7365722e707567782e6f72672f796969636f642f796969322d67656f2f646f776e6c6f616473)](https://packagist.org/packages/yiicod/yii2-geo) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/331b056b183ba47618c100c0485f3ebf6c2355e22b5f5fbf1c52c45fd8c2a167/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f796969636f642f796969322d67656f2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/yiicod/yii2-geo/?branch=master)[![Code Climate](https://camo.githubusercontent.com/517e35973fbe3dabce80a4f1d4236943b861af9a9ccf295468d6395e93ea43d4/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f796969636f642f796969322d67656f2f6261646765732f6770612e737667)](https://codeclimate.com/github/yiicod/yii2-geo)

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

#### Installation

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

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

```

or add

```
"yiicod/yii2-geo": "*"
```

to the require section of your composer.json.

#### Config for frontend

[](#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

[](#usage)

```
\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),
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~157 days

Total

3

Last Release

2849d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7934283ca98b7f31bb5bf13119a8495cad80ac9097125a48792f47caddb588b9?d=identicon)[lexxorlov](/maintainers/lexxorlov)

---

Top Contributors

[![lexxorlov](https://avatars.githubusercontent.com/u/7910574?v=4)](https://github.com/lexxorlov "lexxorlov (2 commits)")[![orlov-alexey](https://avatars.githubusercontent.com/u/95412821?v=4)](https://github.com/orlov-alexey "orlov-alexey (1 commits)")

---

Tags

geoip-locationip-locatoryii2yii2-extension

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/yiicod-yii2-geo/health.svg)

```
[![Health](https://phpackages.com/badges/yiicod-yii2-geo/health.svg)](https://phpackages.com/packages/yiicod-yii2-geo)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
