juckzhang/yii2-ip-look-up
Composer 安装命令:
composer require juckzhang/yii2-ip-look-up
包简介
QQWry、upLookup、ipToCity integration for the Yii2 framework
README 文档
README
根据ip获取对应的城市名称 qqwry QQWry
Installation
The preferred way to install this extension is through composer.
Either run
composer require juckzhang/yii2-ip-look-up:*
or add
"juckzhang/yii2-ip-look-up": "*"
to the require section of your composer.json.
Configuration
To use this extension, simply add the following code in your application configuration:
[配置]
/** QiNiu **/ return [ 'components' => [ 'ipLookUp' => [ 'class' => 'juckzhang\ipLookUp\IpLookUp', 'file' => 'qqwry.dat'//纯真ip库文件地址 ], ]
[使用]
1、更新纯真ip库文件 \Yii::$app->get('ipLookUp')->updateQqWryFile(); 2、根据ip返回城市信息 \Yii::$app->get('ipLookUp')->ipLookUp($ip);
Tricks
- 给配置的组件加 IDE 自动补全 IDE autocompletion for custom components
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-04-21