Download the PHP package larva/laravel-ip2region without Composer

On this page you can find all versions of the php package larva/laravel-ip2region. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-ip2region

laravel-ip2region

Laravel 的 ip2region 位置查询模块

Latest Stable Version Latest Unstable Version

本库基于 ip2region ,简单整合方便使用Composer来管理。

Ip2region 是什么?

ip2region - 准确率 99.9% 的离线IP地址定位库,0.0x 毫秒级查询,ip2region.db 数据库只有数MB,提供了查询绑定和 Binary, B 树,内存三种查询算法。

Ip2region 特性

99.9%准确率

数据聚合了一些知名ip到地名查询提供商的数据,这些是他们官方的的准确率,经测试着实比经典的纯真IP定位准确一些。
ip2region的数据聚合自以下服务商的开放API或者数据(升级程序每秒请求次数2到4次):
01, >80%, 淘宝IP地址库, http://ip.taobao.com/
02, ≈10%, GeoIP, https://geoip.com/
03, ≈2%, 纯真IP库, http://www.cz88.net/
备注:如果上述开放API或者数据都不给开放数据时ip2region将停止数据的更新服务。

标准化的数据格式

每条ip数据段都固定了格式:

只有中国的数据精确到了城市,其他国家有部分数据只能定位到国家,后前的选项全部是0,已经包含了全部你能查到的大大小小的国家(请忽略前面的城市Id,个人项目需求)。

体积小

包含了全部的 IP,生成的数据库文件 ip2region.db 只有几MB,最小的版本只有 1.5MB,随着数据的详细度增加数据库的大小也慢慢增大,目前还没超过8MB。

查询速度快

全部的查询客户端单次查询都在 0.x 毫秒级别,内置了三种查询算法

  1. memory 算法:整个数据库全部载入内存,单次查询都在 0.1x 毫秒内,C语言的客户端单次查询在 0.00x 毫秒级别。
  2. binary 算法:基于二分查找,基于 ip2region.db 文件,不需要载入内存,单次查询在 0.x 毫秒级别。
  3. b-tree 算法:基于 btree 算法,基于 ip2region.db 文件,不需要载入内存,单词查询在 0.x 毫秒级别,比 binary 算法更快。

任何客户端 b-tree 都比 binary 算法快,当然 memory 算法固然是最快的!

环境需求

安装


All versions of laravel-ip2region with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
illuminate/support Version ^9.0 || ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package larva/laravel-ip2region contains the following files

Loading the files please wait ....