phalcon-plugins/ip-data 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phalcon-plugins/ip-data

Composer 安装命令:

composer require phalcon-plugins/ip-data

包简介

Allows lookup the location of any IP address

README 文档

README

Plugin allows lookup the location of any IP address

website

https://ipdata.co/

link to documentation

https://docs.ipdata.co/

How to use

  • As a shared service from json file

Create file in json format and save in desired folder

{
        "sharedServices": {
            "ipdata": {
                "className": "\\PhalconPlugins\\IpData",
                "properties": [
                    {
                        "name": "apiKey",
                        "value": {
                            "type": "parameter",
                            "value": "your-ip-data-api-key"
                        }
                    },
                    {
                        "name": "baseUrl",
                        "value": {
                            "type": "parameter",
                            "value": "https://api.ipdata.co"
                        }
                    }
                ]
            }
        }
}

In your application read the file with Phalcon Json adatper an Load as a shared service

$sharedServices = new Phalcon\Config\Adapter\Json('path-to-json-file-with-shared-services');

foreach ($sharedServices->path('sharedServices', []) as $shareName => $options) {

    $di->setShared($shareName, $options->toArray());
    
};

Call anywere in your application ( controllers or plugins )

$ipdata = $this->ipdata->locate('ip-address-to-locate');

  • As a instance of class
$ipdata = new PhalconPlugins\IpData();

$ipdata->setApiKey('your-api-key');

$ipdata->setBaseUrl('https://api.ipdata.co');

$data = $ipdata->locate('ip-address-to-locate');

统计信息

  • 总下载量: 57
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固