PHPackages                             lulubin/yii2-ip2location - 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. lulubin/yii2-ip2location

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

lulubin/yii2-ip2location
========================

An Yii2 extension for ip to location

1.0.2(5mo ago)06MITPHP

Since Jul 25Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/lulubin/yii2-ip2location)[ Packagist](https://packagist.org/packages/lulubin/yii2-ip2location)[ Docs](https://github.com/lulubin/yii2-ip2location)[ RSS](/packages/lulubin-yii2-ip2location/feed)WikiDiscussions main Synced 1mo ago

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

1.Install
---------

[](#1install)

composer require --prefer-dist lulubin/yii2-ip2location "dev-master"

2.Usage
-------

[](#2usage)

根据IP查询
------

[](#根据ip查询)

```
use lulubin\ip2location\Ip2Location;
$ipLocation = new Ip2Location();
$locationModel = $ipLocation->getLocation('8.8.8.8');
print_r($locationModel->toArray());
/* Array
 (
    [ip] => 8.8.8.8
    [begin_ip] => 8.8.8.8
    [end_ip] => 8.8.8.8
    [country] => 美国
    [area] => 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器
 )*/
```

升级数据库
-----

[](#升级数据库)

```
use lulubin\ip2location\QQWry;
$qqwry = new QQWry();
$qqwry->upgrade();
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance73

Regular maintenance activity

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Every ~872 days

Total

2

Last Release

151d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38f0f8abc454bb4b20dac2a2221c0bbe12e8c39dde9a5312874b297954fbc744?d=identicon)[lulubin](/maintainers/lulubin)

---

Top Contributors

[![lulubin](https://avatars.githubusercontent.com/u/15922843?v=4)](https://github.com/lulubin "lulubin (3 commits)")

---

Tags

yii2extensionip2location

### Embed Badge

![Health badge](/badges/lulubin-yii2-ip2location/health.svg)

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

###  Alternatives

[vyants/yii2-daemon

Extension provides functionality for simple daemons creation and control

7859.0k](/packages/vyants-yii2-daemon)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[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)
