定制 foxliscom/geo 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

foxliscom/geo

Composer 安装命令:

composer require foxliscom/geo

包简介

Get user location by IP using Foxlis Geo API: city, country, subdivisions, continent, etc

README 文档

README

This plug-in use Foxlis Geo API.

Installation

Require foxliscom/geo using composer.

Usage

use Foxliscom\Geo\FoxlisGeo;

// Get City
echo FoxlisGeo::location()->getCity();

// Get Country
echo FoxlisGeo::location()->getCountry();

// Get Continent
echo FoxlisGeo::location()->getContinent();

// Get Subdivisions List
$subdivisions = FoxlisGeo::location()->getSubdivisions();

// Get Location Data
$locationData = FoxlisGeo::location()->getLocation();

// Get Accuracy Radius
echo $locationData->getAccuracyRadius();

// Get Latitude
echo $locationData->getLatitude();

// Get Longitude
echo $locationData->getLongitude();

// Get Time Zone
echo $locationData->getTimeZone();

// Get Account Info
FoxlisGeo::account()->getData();

Multilanguage example:

// Russian
echo FoxlisGeo::location()->getCity()->ru;

// Spanish
echo FoxlisGeo::location()->getCity()->es;

// English
echo FoxlisGeo::location()->getCity()->en;

// German
echo FoxlisGeo::location()->getCity()->de;

// French
echo FoxlisGeo::location()->getCity()->fr;

// Japanese
echo FoxlisGeo::location()->getCity()->ja;

// Portuguese
echo FoxlisGeo::location()->getCity()->ptBR;

// Chinese
echo FoxlisGeo::location()->getCity()->zhCN;

Configuration

If you need to configure this plug-in - declare a global function getFoxlisGeoConfig with params like in common config src/Config/common.php:

function getFoxlisGeoConfig()
{
    return [
        // Your params here
    ];
}
  • foxlis_geo_field_language - default language default en.
    • English en
    • Chinese zh-CN
    • French fr
    • Russian ru
    • German de
    • Spanish es
    • Japanese ja
    • Portuguese pt-BR
  • foxlis_geo_field_session - save result to user session default true.
  • foxlis_geo_field_bot_filter - don't detect geo-location for bots default true.
  • foxlis_geo_field_protocol - protocol "http" or "https" default "http".
  • foxlis_geo_field_development_fake_ip_enable - use fake ip for development default false.
  • foxlis_geo_field_development_fake_ip - fake ip value default "23.55.115.223".
  • foxlis_geo_field_account - account key to get account info.
  • foxlis_geo_bots_list - bots list (for matching in the $_SERVER['HTTP_USER_AGENT']).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固