Download the PHP package pangongzi/mobile without Composer

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

MobileLocator - 高性能手机号码归属地查询库

Latest Stable Version Total Downloads License PHP Version Build Status

📱 项目简介

MobileLocator 是一个专为中国大陆手机号码设计的高性能归属地查询库。基于优化的二进制数据文件和内存映射技术,提供毫秒级的查询响应速度,适用于高并发的生产环境。

🔥 核心优势

🚀 快速开始

安装

基础使用

📊 性能表现

基准测试结果

测试项目 数值 说明
单次查询耗时 0.08ms 平均响应时间
QPS 12,474 每秒查询数
内存占用 ~5MB 数据文件内存映射
并发支持 1000+ 同时查询连接数

性能优化亮点

与其他方案对比

方案 查询速度 内存占用 依赖 适用场景
MobileLocator ⭐⭐⭐⭐⭐ 高并发生产环境
数据库查询 ⭐⭐⭐ MySQL/Redis 复杂业务场景
网络API ⭐⭐ 网络 简单应用场景

🛠️ 完整API参考

MobileLocator 类

📌 核心方法

getInstance(string $dataFile = ''): self

获取单例实例

find(string|int $mobile): ?array

查询手机号归属地信息

📊 元信息方法

getVersion(): int

获取数据文件版本号

getIndexCount(): int

获取索引记录总数

getOperatorTypes(): array

获取运营商类型映射表

📁 数据文件规范

文件结构

版本号格式说明

版本号 842020146 解析:

这表明数据文件采用了ASCII编码的版本标识方式。

索引区格式

每条索引记录9字节:

记录区格式

每条记录格式:"<省份>|<城市>|<邮编>|<区号>\0"

🏗️ 系统架构

设计模式

核心组件

🛡️ 错误处理与异常

异常类型

输入验证规则

📈 生产环境部署

最佳实践

性能调优建议

  1. 内存优化: 确保PHP内存限制 >= 16MB
  2. OPcache: 启用OPcache提升代码执行效率
  3. 预热机制: 应用启动时执行几次查询预热缓存

🔧 开发与测试

本地开发环境

📋 版本更新日志

详细更新历史请查看 CHANGELOG.md

最近重要更新

⚠️ 注意事项与限制

重要提醒

  1. 携号转网影响: 由于2019年11月起实施的携号转网政策,运营商信息可能不准确
  2. 数据时效性: 建议每季度更新数据文件以获得最新号段信息
  3. 内存使用: 数据文件约5MB,请确保足够的内存空间
  4. PHP版本: 需要PHP 7.4+(推荐PHP 8.0+)
  5. 适用范围: 仅支持中国大陆11位手机号码

已知限制

🤝 贡献指南

我们欢迎各种形式的贡献!

贡献方式

  1. 🐛 报告bug和问题
  2. 💡 提出功能建议
  3. 🔧 提交代码改进
  4. 📖 完善文档说明

开发流程

📄 许可证

本项目采用 MIT License 开源协议,详情请查看 LICENSE 文件。

🙏 致谢

特别感谢以下开源项目的启发和支持:

📞 联系方式

📧 邮箱: [email protected]
🌐 GitHub: https://github.com/pangongzi


📦 Made with ❤️ for the PHP Community


All versions of mobile with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 pangongzi/mobile contains the following files

Loading the files please wait ...