承接 victorybiz/geoip-location 相关项目开发

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

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

victorybiz/geoip-location

Composer 安装命令:

composer require victorybiz/geoip-location

包简介

Get the geographical location of website visitors based on their IP addresses. Support Laravel and PHP (Non-Laravel) Project.

README 文档

README

GitHub release Software License Build Status Packagist

Get the geographical location of website visitors based on their IP addresses. Support Laravel and PHP (Non-Laravel) Project.

Installation

Install using composer, from the command line run:

$ composer require victorybiz/geoip-location

Laravel Project

Alternatively, you can add "victorybiz/geoip-location": "^1.1" to your composer.json file's require section and then you'll then need to run composer install or composer update to download it and have the autoloader updated.

If you use Laravel >= 5.5 you can skip this step and go to usage

If you use Laravel < 5.5, you need to register the service provider with the application. Open up config/app.php and locate the providers key.

'providers' => [

    Victorybiz\GeoIPLocation\GeoIPLocationServiceProvider::class,

]

And add the GeoIPLocation alias to config/app.php:

'aliases' => [

	'GeoIPLocation' => Victorybiz\GeoIPLocation\Facades\GeoIPLocationFacade::class,

]

Usage in Laravel Project

Please use the GeoIPLocation Facade

use GeoIPLocation;

echo GeoIPLocation::getIP(); // Return client IP

PHP (Non-Laravel) Project

Require the vendor autoload file in your php script.

    require_once 'path/to/vendor/autoload.php';

Usage

Localhost IP 127.0.0.1, 192.168.65.0, 172.18.0.1 and ::1 will return 169.159.82.111 to assert a valid geo response.

    use Victorybiz\GeoIPLocation\GeoIPLocation;

    $geoip = new GeoIPLocation(); 

    // OR

    $geoip = new GeoIPLocation([
        'ip' => null, // Set IP.  Default is NULL, will be auto set by the package
        'baseCurrency' => 'USD', // Set base currency for exchange rate. Default is USD
    ]);

Alternatively

    $geoip = new \Victorybiz\GeoIPLocation\GeoIPLocation();

    // OR

    $geoip = new \Victorybiz\GeoIPLocation\GeoIPLocation([
        'ip' => null, // Set IP.  Default is NULL, will be auto set by the package
        'baseCurrency' => 'USD', // Set base currency for exchange rate. Default is USD
    ]);

You're good to go, explore the package

    echo $geoip->getIP(); // Return client IP

    echo $geoip->setIP('0.0.0.0'); // Set an IP to get its geographical location

    echo $geoip->getCity(); // Return client IP City (null if none)

    echo $geoip->getRegion(); // Return client IP Region (null if none)

    echo $geoip->getRegionCode(); // Return client IP Region Code (null if none)

    echo $geoip->getCountry(); // Return client IP Country

    echo $geoip->getCountryCode(); // Return client IP Country Code

    echo $geoip->getContinent(); // Return client IP Continent 

    echo $geoip->getContinentCode(); // Return client IP Continent Code

    echo $geoip->getPostalCode(); // Return client IP Postal Code (null if none)

    echo $geoip->getLatitude(); // Return client IP Latitude (null if none)

    echo $geoip->getLongitude(); // Return client IP Longitude (null if none)

    echo $geoip->getCurrencyCode(); // Return client IP Country Currency Code (null if none)

    echo $geoip->getCurrencySymbol(); // Return client IP Country Currency Symbol (null if none)

    echo $geoip->getCurrencyExchangeRate(); // Return client IP Country Currency Exchange Rate against NGN (null if none)

    echo $geoip->getLocation(); // Return client IP Location string (city, region, country)

Web Services

Bug Reports and Issue tracking

Kindly make use of the issue tracker for bug reports, feature request, additional web service request and security issues.

License

MIT

victorybiz/geoip-location 适用场景与选型建议

victorybiz/geoip-location 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 167.49k 次下载、GitHub Stars 达 22, 最近一次更新时间为 2017 年 08 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「github」 「geoip」 「laravel」 「open source」 「laravel 5」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 victorybiz/geoip-location 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 victorybiz/geoip-location 我们能提供哪些服务?
定制开发 / 二次开发

基于 victorybiz/geoip-location 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 167.49k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 23
  • 点击次数: 31
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 22
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-01