udger/udger-php-v4
Composer 安装命令:
composer require udger/udger-php-v4
包简介
PHP agent string parser based on Udger https://udger.com/products/local_parser
README 文档
README
Local parser is very fast and accurate useragent string detection solution. Enables developers to locally install and integrate a highly-scalable product. We provide the detection of the devices (personal computer, tablet, Smart TV, Game console etc.), operating system, client SW type (browser, e-mail client etc.) and devices market name (example: Sony Xperia Tablet S, Nokia Lumia 820 etc.). It also provides information about IP addresses (Public proxies, VPN services, Tor exit nodes, Fake crawlers, Web scrapers, Datacenter name .. etc.)
- Tested with more the 1.000.000 unique user agents.
- Processes Google User-Agent Client Hints
- Up to date data provided by https://udger.com/
Requirements
- php >= 5.5.0
- ext-sqlite3 (http://php.net/manual/en/book.sqlite3.php)
- datafile v4 (udgerdb_v4.dat) from https://data.udger.com/
Features
- Fast
- LRU cache
- Released under the MIT
Install
composer require udger/udger-php-v4
Usage
You should review the included examples (parseUA-IP.php, parseSec-Ch.php ... etc)
Here's a quick example:
$factory = new Udger\ParserFactory(sys_get_temp_dir() . "/udgercache/udgerdb_v4.dat"); $parser = $factory->getParser(); // enable/disable LRU cache $parser->setCacheEnable(false); // default is enable //$parser->setCacheSize(4000); // default size is 3000 try { $parser->setSecChUa('"Chromium";v="104", " Not A;Brand";v="99", "Google Chrome";v="104"'); $parser->setUA('Mozilla/5.0 (Linux; Android 11; CPH2001) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Mobile Safari/537.36'); $parser->setSecChUaMobile('?1'); $parser->setSecChUaFullVersion('"104.0.5112.97"'); $parser->setSecChUaPlatform('"Android"'); $parser->setSecChUaPlatformVersion('"11.0.0"'); $parser->setSecChUaModel('"CPH2001"'); $ret = $parser->parse(); print_r($ret); } catch (Exception $ex) { echo "Error: " . $ex->getMessage(). PHP_EOL; }
Automatic updates download
- for autoupdate data use Udger data updater (https://udger.com/support/documentation/?doc=62)
Author
- The Udger.com Team (info@udger.com)
v3 format
For the previous data format (v3), please use https://github.com/udger/udger-php
udger/udger-php-v4 适用场景与选型建议
udger/udger-php-v4 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 190.57k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 08 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 udger/udger-php-v4 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 udger/udger-php-v4 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 190.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-25