PHPackages                             sablesoft/yii2-geoip - 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. sablesoft/yii2-geoip

ActiveYii2-extension

sablesoft/yii2-geoip
====================

GeoIP component for yii2 application

v1.0.0(5y ago)061LGPL-3.0+PHPPHP &gt;=7.2

Since Jul 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sablesoft/yii2-geoip)[ Packagist](https://packagist.org/packages/sablesoft/yii2-geoip)[ RSS](/packages/sablesoft-yii2-geoip/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

Yii2 GeoIP
==========

[](#yii2-geoip)

Installation
------------

[](#installation)

The preferred way to install the **geoip** is through [composer](http://getcomposer.org/download/).

Either run

```
composer require sablesoft/yii2-geoip

```

or add

```
"sablesoft/yii2-geoip": "*",
```

to the require section of your composer.json.

Then add **geoip** in your app config:

```
    'components' => [
        'geoip'   => [
            'class'      => 'sablesoft\geoip\GeoIP',
            'dbPath'     => '/path/to/your/geoip/database'
        ]
    ]
```

How to Use
----------

[](#how-to-use)

Use `get` method to get IP data:

```
$ip = "52.141.159.163";
/** @var \sablesoft\geoip\IpData $ipData */
$ipData = \Yii::$app->geoip->get($ip);
$country = $ipData->countryName;
$city   = $ipData->cityName;
$code = $ipData->countryCode;

$default = false;
$path = "some.path.in.ip.data.array";
$someData = $ipData->get($path, $default);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2137d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d9b0f205c28816c7412e64ffc94536e0c7e796bcf1b2066caea1c6167cb2c0f?d=identicon)[sablesoft](/maintainers/sablesoft)

---

Top Contributors

[![sablesoft](https://avatars.githubusercontent.com/u/13505325?v=4)](https://github.com/sablesoft "sablesoft (1 commits)")

---

Tags

geoipyii2sablesoft

### Embed Badge

![Health badge](/badges/sablesoft-yii2-geoip/health.svg)

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

PHPackages © 2026

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