rubricate/agent
Composer 安装命令:
composer require rubricate/agent
包简介
Dentifies the platform, browser, robot, or mobile device of the browsing agent
关键字:
README 文档
README
Last Version
$ composer require rubricate/agent
Documentation is at https://rubricate.github.io/components/agent
Preparing the Configuration Data
<?php $config = [ 'platforms' => [ 'windows nt 10.0' => 'Windows 10', 'android' => 'Android', 'iphone' => 'iPhone', 'linux' => 'Linux', 'ubuntu' => 'Ubuntu Linux', 'fedora' => 'Fedora Linux', 'x11' => 'Linux (Generic)' ], 'browsers' => [ 'Chrome' => 'Chrome', 'Firefox' => 'Firefox', 'MSIE' => 'Internet Explorer', ], 'mobiles' => [ 'iphone' => 'Apple iPhone', 'android' => 'Android Device', ], 'robots' => [ 'googlebot' => 'Googlebot', ] ];
Preparing the Configuration Data
<?php use Rubricate\Agent\UserAgent; // 1. Instantiate the class passing the configurations $ua = new UserAgent($config); // 2. Checking the device type if ($ua->isMobile()) { echo "You are using a mobile device: " . $ua->getMobile(); } elseif ($ua->isRobot()) { echo "Hello, robot: " . $ua->getRobot(); } else { echo "You are on a Desktop."; } echo "<br>"; // 3. Obtaining specific browser information if ($ua->isBrowser()) { echo "Browser: " . $ua->getBrowser() . " (Version: " . $ua->getVersion() . ")"; } echo "<br>"; // 4. Checking the Platform (OS) echo "Operating System: " . $ua->getPlatform(); echo "<br>"; / 5. Accepted Languages echo "Preferred Languages: " . implode(', ', $ua->getLanguages()); / 6. Specific Boolean Check if ($ua->acceptLang('pt-br')) { echo "The user accepts Brazilian Portuguese."; }
Credits
- Estefanio N Santos (Developer)
- All Contributors (Let's program)
License
The MIT License (MIT). Please see License File for more information.
rubricate/agent 适用场景与选型建议
rubricate/agent 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 50 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「parser」 「user-agent」 「Agent」 「browser-detection」 「infrastructure」 「solid」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rubricate/agent 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rubricate/agent 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rubricate/agent 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Detect user Browser, OS and Device through Browser USER AGENT
Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.
Platine User Agent is a lightweight library for detecting user browser, device, OS, CPU
Custom laravel monolog logger for datadog logs management, both api and agent ways
An MT940 bank statement parser for PHP
Official PHP SDK for the IPGeolocation.io IP Location API with single and bulk lookup support.
统计信息
- 总下载量: 50
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 43
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-07