PHPackages                             dpodium/yii2-geoip-city-db - 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. dpodium/yii2-geoip-city-db

ActiveYii2-extension

dpodium/yii2-geoip-city-db
==========================

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

1.1(11mo ago)218.6k↓32.1%MITShell

Since Jun 12Pushed 11mo ago4 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (55)Used By (0)

Yii2 GeoIP - City DB version
============================

[](#yii2-geoip---city-db-version)

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

Based on package phiphi1992/Yii2-GeoIP by Phi Hoang Xuan.

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

[](#installation)

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

Either run

```
php composer.phar require dpodium/yii2-geoip-city-db "~0.2"

```

or add

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

```

to the require section of your `composer.json` file.

Component Setup
---------------

[](#component-setup)

Once the extension is installed, simply modify your application configuration as follows:

```
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](https://github.com/dpodium/yii2-geoip).

For more information on the data availability, see below.

Usage
-----

[](#usage)

All methods accept an IP address as an argument. If no argument is supplied Yii::$app-&gt;getRequest()-&gt;getUserIP() is used.

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

```

Location attributes:

```
$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

```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance50

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 55.9% 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 ~49 days

Recently: every ~85 days

Total

53

Last Release

350d ago

Major Versions

0.92 → 1.02025-01-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7d4729d14d133df43f29028b24bdf23a9ceadbc94012de1b7ec02ce58c55e02?d=identicon)[dpodium](/maintainers/dpodium)

---

Top Contributors

[![ierawahid](https://avatars.githubusercontent.com/u/32503537?v=4)](https://github.com/ierawahid "ierawahid (33 commits)")[![darrenng-dpodium](https://avatars.githubusercontent.com/u/12998063?v=4)](https://github.com/darrenng-dpodium "darrenng-dpodium (22 commits)")[![chingyen29](https://avatars.githubusercontent.com/u/54927097?v=4)](https://github.com/chingyen29 "chingyen29 (2 commits)")[![domong14](https://avatars.githubusercontent.com/u/177703636?v=4)](https://github.com/domong14 "domong14 (1 commits)")[![weichen-dpodium](https://avatars.githubusercontent.com/u/19607266?v=4)](https://github.com/weichen-dpodium "weichen-dpodium (1 commits)")

---

Tags

geoipmaxmindyii2extension

### Embed Badge

![Health badge](/badges/dpodium-yii2-geoip-city-db/health.svg)

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

###  Alternatives

[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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