mimmi20 / ua-result
该软件包已被废弃,不再维护。没有建议的替代软件包。
用于处理用户代理解析结果的 PHP 7.4+ 库
9.0.3
2023-08-15 06:58 UTC
Requires
- php: ^8.1.0
- ext-mbstring: *
- mimmi20/browser-detector-version: ^8.0.0
- mimmi20/ua-browser-type: ^9.0.0
- mimmi20/ua-device-type: ^9.0.0
Requires (Dev)
- ext-ctype: *
- ext-dom: *
- ext-simplexml: *
- ext-tokenizer: *
- ext-xml: *
- ext-xmlwriter: *
- infection/infection: ^0.27.0
- mimmi20/coding-standard: ^5.1.10
- nikic/php-parser: ^4.17.1
- phpstan/extension-installer: ^1.3.1
- phpstan/phpstan: ^1.10.29
- phpstan/phpstan-deprecation-rules: ^1.1.4
- phpstan/phpstan-phpunit: ^1.3.13
- phpunit/phpunit: ^10.3.1
- rector/rector: ^0.17.13
- vimeo/psalm: ^5.14.1
- dev-master
- 9.0.3
- 9.0.2
- 9.0.1
- 9.0.0
- 8.0.7
- 8.0.6
- 8.0.5
- 8.0.4
- 8.0.3
- 8.0.2
- 8.0.1
- 8.0.0
- 7.2.0
- 7.1.8
- 7.1.7
- 7.1.6
- 7.1.5
- 7.1.4
- 7.1.3
- 7.1.2
- 7.1.1
- 7.1.0
- 7.0.6
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.2.5
- 5.2.4
- 5.2.3
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.2
- 5.1.1
- 5.1.0
- 5.0.2
- 5.0.1
- 5.0.0
- 4.0.0
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.1
- 2.0.0
- 2.0.0-alpha4
- 2.0.0-alpha3
- 2.0.0-alpha2
- 2.0.0-alpha
- 1.1.0
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dependabot/composer/master/minor-patch-dependencies-ad3f554d14
This package is auto-updated.
Last update: 2023-09-16 11:58:29 UTC
README
代码状态
描述
此库提供了一组表示用户代理检测结果的类。
要求
此库需要 PHP 7.4+。还需要一个 PSR-3 兼容的日志记录器。
安装
运行以下命令通过 Composer 安装
composer require mimmi20/ua-result
结果对象
结果对象是主要对象,仅包含其他对象。
浏览器对象
浏览器对象代表检测到的浏览器。
// get the result by detection or create it $browser = $result->getBrowser(); // get the name $name = $browser->getName(); // get the manufaturer $manCompany = $browser->getManufacturer()->getName(); $manBrand = $browser->getManufacturer()->getBrandName(); // get the version $name = $browser->getVersion()->getVersion(); // get the type $type = $browser->getType()->getName(); $isbot = $browser->getType()->isBot();
引擎对象
引擎对象代表检测到的渲染引擎。
// get the result by detection or create it $engine = $result->getEngine(); // get the name $name = $engine->getName(); // get the manufaturer $manCompany = $engine->getManufacturer()->getName(); $manBrand = $engine->getManufacturer()->getBrandName(); // get the version $name = $engine->getVersion()->getVersion();
设备对象
设备对象代表检测到的设备。
// get the result by detection or create it $device = $result->getDevice(); // get the (code) name $name = $device->getDeviceName(); // the device may have a different marketing name $mname = $device->getMarketingName(); // get the manufaturer $manCompany = $device->getManufacturer()->getName(); $manBrand = $device->getManufacturer()->getBrandName(); // the device may be a branded version $brand = $device->getBrand()->getBrandName(); // does the device support dual orientation? $dualorien = $device->getDualOrientation(); // get the pointing method $pointing = $device->getPointingMethod(); // get the display dimensions $height = $device->getResolutionHeight(); $width = $device->getResolutionWidth(); // get some more information about the device type $type = $device->getType()->getName(); $isPhone = $device->getType()->isPhone(); $isTablet = $device->getType()->isTablet();
平台对象
平台对象代表检测到的平台。
// get the result by detection or create it $platform = $result->getOs(); // get the (code) name $name = $platform->getName(); // the platform may have a different marketing name $mname = $platform->getMarketingName(); // get the manufaturer $manCompany = $platform->getManufacturer()->getName(); $manBrand = $platform->getManufacturer()->getBrandName(); // get the version $name = $platform->getVersion()->getVersion();
问题和功能请求
请在 GitHub 问题跟踪器 https://github.com/mimmi20/ua-result/issues 上报告您的问题并请求新功能。