jisoft/yii2-sypexgeo 问题修复 & 功能扩展

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

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

jisoft/yii2-sypexgeo

Composer 安装命令:

composer require jisoft/yii2-sypexgeo

包简介

Yii2 extension for Sypex Geo API (http://sypexgeo.net)

README 文档

README

Yii2 extension for Sypex Geo API

Sypex Geo - product for location by IP address. Obtaining the IP address, Sypex Geo outputs information about the location of the visitor - country, region, city, geographical coordinates and other in Russian and in English. Sypex Geo use local compact binary database file and works very quickly. For more information visit: http://sypexgeo.net/

This Yii2 extension allow use Sypex Geo API in Yii2 application.

Usage

Once the extension is installed, simply use it in your code by :

<?php $geo = new \jisoft\sypexgeo\Sypexgeo(); // get by remote IP $geo->get(); // also returned geo data as array echo $geo->ip,'<br>'; echo $geo->ipAsLong,'<br>'; var_dump($geo->country); echo '<br>'; var_dump($geo->region); echo '<br>'; var_dump($geo->city); echo '<br>'; // get by custom IP $geo->get('212.42.76.252'); ?>

Information about country, region and city returned as array. For example:

Country array ( 'id' => 222, 'iso' => 'UA', 'continent' => 'EU', 'lat' => 49, 'lon' => 32, 'name_ru' => 'Украина', 'name_en' => 'Ukraine', 'timezone' => 'Europe/Kiev', ), Region array ( 'id' => 709716, 'lat' => 48, 'lon' => 37.5, 'name_ru' => 'Донецкая область', 'name_en' => 'Donets\'ka Oblast\'', 'iso' => 'UA-14', 'timezone' => 'Europe/Zaporozhye', 'okato' => '14', ), City array ( 'id' => 709717, 'lat' => 48.023000000000003, 'lon' => 37.802239999999998, 'name_ru' => 'Донецк', 'name_en' => 'Donets\'k', 'okato' => '14101', ),

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist jisoft/yii2-sypexgeo "*" 

or add

"jisoft/yii2-sypexgeo": "*" 

to the require section of your composer.json file.

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 3
  • Forks: 24
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固