2017 © Pedro Peláez
 

yii2-extension ipinfo

Get Ip Info API

image

mrfeng/ipinfo

Get Ip Info API

  • Wednesday, June 22, 2016
  • by MRfeng
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2 Ip 归属地查询, (*1)

现整合了淘宝,腾讯,新浪三个查询API接口,后期会增加其他接口, (*2)

安装步骤:, (*3)

1、下载安装, (*4)

    $ php composer.phar require mrfeng/ipinfo "*"

或者在composer.json中添加一下配置, (*5)

    mrfeng/ipinfo "*"

然后运行, (*6)

composer update

2、配置, (*7)

return [
    'components' => [
            'ipinfo' => [            
                // 淘宝API
                'class' => 'mrfeng\ipinfo\TaoBaoIpInfo',
        ]
    ],
];

或, (*8)

return [
    'components' => [
            'ipinfo' => [            
                // 腾讯API
                'class' => 'mrfeng\ipinfo\QQIpInfo',
        ]
    ],
];

或, (*9)

return [
    'components' => [
            'ipinfo' => [            
                // SINA API
                'class' => 'mrfeng\ipinfo\SinaIpInfo',
        ]
    ],
];

3、应用, (*10)

    Yii::$app->ipinfo->getinfo('127.0.0.1');//查询指定的IP地址

会返回一个IP归属地的字符串, (*11)

The Versions

22/06 2016

dev-master

9999999-dev

Get Ip Info API

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Avatar MRfeng