Coder Social home page Coder Social logo

ip-database's People

Contributors

itbdw avatar whirlwind110 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ip-database's Issues

IPv6 结果存在\t制表符

{"ip":"2400:3200:baba::1","country":"**","province":"**\t浙江","city":"\t杭州市","county":"","area":"****\t浙江\t杭州市 阿里云计算有限公司","isp":""}

v3.x 可以支持 PHP8不

Problem 1
- Root composer.json requires itbdw/ip-database ^3.0 -> satisfiable by itbdw/ip-database[3.0.0].
- itbdw/ip-database 3.0.0 requires php ~5.4|~7.0 -> your php version (8.0.8) does not satisfy that requirement.

一个疑问,是这样的,我复制作者到创建的仓库,就出现一个问题

主要是我一直用国内:阿里云镜像,快啊。
但是无法安装作者你写的。。用原生repo.packagist.org慢啊。。
这是我自己复制到我仓库的:https://github.com/hulang/think-ip
目前出现一个问题,一直提示错误:
unpack(): Type V: not enough input, need 4, have 1
如果可以,作者你指点下啊。。最好能使用:阿里云镜像更新。。。我就不用复制仓库了。。
@itbdw

返回 无数据2020年1月15日IP数据

["ip"]=> string(14) "115.226.116.52" ["beginip"]=> string(13) "255.255.255.0" ["endip"]=> string(15) "255.255.255.255" ["country"]=> string(8) "纯真网络" ["area"]=> string(19) "2020年1月15日IP数据"

需要更新ip库了

ip 116.139.189.164,解析出来是北京,实际是辽宁的
版本"itbdw/ip-database": "^3.0",

找不到 QQwry 类

Fatal error: Uncaught Error: Class 'itbdw\Ip\IpParser\QQwry' not found in /ip-database/src/IpLocation.php on line 47

直接使用file_get_contents下载 会出错。 需要添加 header 信息。

$copywrite = curls_get("http://update.cz88.net/ip/copywrite.rar");
$qqwry = curls_get("http://update.cz88.net/ip/qqwry.rar");

function curls_get($url)
{
$header = ["User-Agent:Mozilla/3.0 (compatible; Indy Library)","Accept:text/html, /"];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 600,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => $header,
CURLOPT_URL => $url,
));
$res = curl_exec($curl);
curl_close($curl);
return $res;
}

need php8+ support

测试 v3.0版本 可以在php8.0环境下运行 , 但Composer require中php版本并未添加php8+

composer require itbdw/ip-database ^3.0.1,不能满足最小稳定版本

❯ composer require itbdw/ip-database ^3.0.1 -W --no-cache
./composer.json has been updated
Running composer update itbdw/ip-database --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires itbdw/ip-database ^3.0.1, found itbdw/ip-database[3.x-dev] but it does not match your minimum-stability.


Installation failed, reverting ./composer.json and ./composer.lock to their original content.

我的 PHP 是 7.4,composer.json 中 minimum-stabilitystable
如果 minimum-stabilitydev 就不会出现这个问题。但这样是不够安全的。

代码重构以及支持 IPV6

新功能

  • 新功能,使用 3.x 分支
  • 不向后兼容。代码结构重新设计。
  • 尝试支持ipdb
  • 支持IPV6
  • 采用民政部公布的区域码

1,时间太长,代码结构不够好。需要重构代码,将读取IP和格式化分开,以支持更多数据源。
2,�尝试联系 http://ip.zxinc.org/ipquery/ 站长,可否使用 ipv6 库

感谢提供源代码,我基于你的代码,移植了Ruby版的gem包

在移植时,我发现有些少数名族的城市名不好提取。比如“四川省凉山州西昌市”,“凉山州”是城市,“西昌市”是县。又如”内蒙古锡林郭勒盟“,”锡林郭勒盟“是城市。

要实现准确提取,我想可能需要**的城市库。要实现这个功能,需要花些时间整理省市区县的数据。不知你在业务应用中是否已经做个这个事了?能否共享出来?

附上我移植的Ruby Gem地址:https://github.com/xiaohui-zhangxh/ip_locator_cn

某些IP的市这个值是乱码

比如:120.193.188.229

看了下,貌似是ltrim引起的问题,ltrim,rtrim啥的不支持中文的,建议使用mb_substr来进行切割

An exception occurrs when querying few specfic IP

Hi,Master
Thx for your project, it really helps.
Rectently, using the tool, I found an issue attached the related logs as follow.
An exception occurrs when encountering the specfic IP 111.12.25.35 as input.
FYI, after I tested some cases, I found the exception occurrs whenever IP involes IP subnet 111.12.. .

### normal test case result is fine
php D:\SRC_Code\PHP_Project\ip-database-2.0.9\tests\ip.php -i 36.147.19.241
{"ip":"36.147.19.241","country":"**","province":"北京","city":"","county":"","isp":"移动","area":"**北京移动"}

### err log ###
php D:\SRC_Code\PHP_Project\ip-database-2.0.9\tests\ip.php -i 111.12.25.35
Fatal error: Uncaught Error: Call to undefined function itbdw\Ip\mb_stripos() in D:\SRC_Code\PHP_Project\ip-database-2.0.9\src\IpLocation.php:276
Stack trace:
#0 D:\SRC_Code\PHP_Project\ip-database-2.0.9\src\IpLocation.php(171): itbdw\Ip\IpLocation->getAddr('111.12.25.35')
#1 D:\SRC_Code\PHP_Project\ip-database-2.0.9\tests\ip.php(43): itbdw\Ip\IpLocation::getLocation('111.12.25.35')
#2 {main}
thrown in D:\SRC_Code\PHP_Project\ip-database-2.0.9\src\IpLocation.php on line 276

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.