Download the PHP package youbuwei/ip-location without Composer

On this page you can find all versions of the php package youbuwei/ip-location. 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 ip-location

IP地址归属地/IP定位

Test Latest Version Php Version Swoole Version Hyperf Version License

安装

配置

基本配置

默认使用了纯真IP数据库,不保证数据的准确性,可自己通过其他方式获取IP地址数据。此外还对接了几个常用的服务商,可配置使用。

将IP数据文件路径配置到config/ip-location.php如下位置中:

因为获取归属地依赖于外部接口,存在不可控的风险,因此设计了一个开关,可以在无可用服务时关闭归属地服务,访问影响其他业务。

通过在 文件中指定使用哪个接口,默认使用

缓存

IP地址归属地在一定时间内是不变化的,因此可以缓存归属地信息,提高性能,减少接口的调用。

对接的服务商

当前支持 ip-api腾讯位置服务百度地图开放平台高德开放平台

ip-api

ip-api.com,无需配置,使用简单,但可能间歇性的无法访问或者访问缓慢,暂时未对接 Pro 服务

腾讯位置服务

使用了腾讯位置服务的IP定位接口,需要首先登录创建应用并申请一个key,如果使用授权签名的方式,还需要需要配置 secret。

百度地图开放平台

百度地图配置参数ak时如果选择使用sn,需要同时配置sk,配置如下:

高德开放平台

自定义对接其他服务商

如果需要对接其他服务商,需要在

使用

使用非常简单,配置好之后实例化 并调用 方法即可

License

The IPLocation Library is open-source software licensed under the MIT license.


All versions of ip-location with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
hyperf/di Version ~3.0.0
hyperf/config Version ~3.0.0
hyperf/guzzle Version ~3.0.0
hyperf/event Version ~3.0.0
hyperf/cache Version ~3.0.0
hyperf/framework Version ~3.0.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 youbuwei/ip-location contains the following files

Loading the files please wait ...