itbdw / ip-database Goto Github PK
View Code? Open in Web Editor NEW免费IP离线数据库,支持IPV4+IPV6 ,国家、省、市、县、运营商
License: Other
免费IP离线数据库,支持IPV4+IPV6 ,国家、省、市、县、运营商
License: Other
替广大人民群众tks你
有没有sql版的 可以导入到数据库的
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
在移植时,我发现有些少数名族的城市名不好提取。比如“四川省凉山州西昌市”,“凉山州”是城市,“西昌市”是县。又如”内蒙古锡林郭勒盟“,”锡林郭勒盟“是城市。
要实现准确提取,我想可能需要**的城市库。要实现这个功能,需要花些时间整理省市区县的数据。不知你在业务应用中是否已经做个这个事了?能否共享出来?
附上我移植的Ruby Gem地址:https://github.com/xiaohui-zhangxh/ip_locator_cn
主要是我一直用国内:阿里云镜像,快啊。
但是无法安装作者你写的。。用原生repo.packagist.org
慢啊。。
这是我自己复制到我仓库的:https://github.com/hulang/think-ip
目前出现一个问题,一直提示错误:
unpack(): Type V: not enough input, need 4, have 1
如果可以,作者你指点下啊。。最好能使用:阿里云镜像更新。。。我就不用复制仓库了。。
@itbdw
请问数据库中IP数量有多少?
namespace itbdw\Ip;
在window可以调用方法,但是在Liunx会出现Class 'itbdw\Ip\IpLocation' not found
❯ 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-stability
是 stable
。
如果 minimum-stability
是 dev
就不会出现这个问题。但这样是不够安全的。
fseek() expects parameter 2 to be integer, float given
["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数据"
我看纯真 license 写的商业不可用?
新功能
1,时间太长,代码结构不够好。需要重构代码,将读取IP和格式化分开,以支持更多数据源。
2,�尝试联系 http://ip.zxinc.org/ipquery/ 站长,可否使用 ipv6 库
"message": "unpack(): Type V: not enough input, need 4, have 0",
"wenji": "....vendor/itbdw/ip-database/src/IpLocation.php",
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.
可以不限制php版本安装吗,我忽略版本后安装是可以用的。
ipv6wry.db软件安装后只有qqwry.dat,ipv6的数据文件不知道有地址不。
3.0版本无法支持php8+吗
测试 v3.0版本 可以在php8.0环境下运行 , 但Composer require中php版本并未添加php8+
{"ip":"2400:3200:baba::1","country":"**","province":"**\t浙江","city":"\t杭州市","county":"","area":"****\t浙江\t杭州市 阿里云计算有限公司","isp":""}
ip 116.139.189.164,解析出来是北京,实际是辽宁的
版本"itbdw/ip-database": "^3.0",
请问这个在代码哪块有体现?非常感谢,望告知
$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;
}
比如:120.193.188.229
看了下,貌似是ltrim引起的问题,ltrim,rtrim啥的不支持中文的,建议使用mb_substr来进行切割
能提供国家名,英文吗?
IPV6查询仅支持64位系统吗?
…………………………………………
文件 http://update.cz88.net/ip/copywrite.rar 已经不存在,更新时会失败
Fatal error: Uncaught Error: Class 'itbdw\Ip\IpParser\QQwry' not found in /ip-database/src/IpLocation.php on line 47
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.