承接 sivolobov/geocoder-ipgeobase 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sivolobov/geocoder-ipgeobase

Composer 安装命令:

composer require sivolobov/geocoder-ipgeobase

包简介

Geocoder provider for IpGeoBase service (Russia).

README 文档

README

SensioLabsInsight

This repository hosts IpGeoBase provider to use with Geocoder library.

Installation

The recommended way to install this package is through Composer:

composer require sivolobov/geocoder-ipgeobase

Usage

You need to read Geocoder's usage documentaion first.

Simple example:

$curl     = new \Ivory\HttpAdapter\CurlHttpAdapter();
$geocoder = new \Geocoder\Provider\IpGeoBase($curl);

$addressCollection = $geocoder->geocode('213.180.193.3');

Symfony integration

To use IpGeoBase in Symfony project you need to install BazingaGeocoderBundle:

After configuring bundle you need to define custom provider. So add these lines to your services.yml:

bazinga_geocoder.provider.ip_geo_base:
    class:  Geocoder\Provider\IpGeoBase
    arguments:
        - "@bazinga_geocoder.geocoder.adapter"
    tags:
        - {name: "bazinga_geocoder.provider"}
    public: false
    lazy:   true

Now you can use it as:

$addressCollection = $this->get('geocoder')->using('ip_geo_base')->geocode($request->getClientIp());

Notes

Note that geocode() return AddressCollection instance but IpGeoBase always return only one address for one IP. So that collection will always have only one element.

License

Geocoder IpGeoBase provider is released under the MIT License. See the bundled LICENSE file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固