nyx-solutions/yii2-nyx-user-agent-parser

Yii2 UserAgent Parser

5.0.0 2022-06-02 14:43 UTC

This package is auto-updated.

Last update: 2024-10-30 01:37:33 UTC


README

A simple streamlined PHP user-agent parser for Yii Framework 2.

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist nyx-solutions/yii2-nyx-user-agent-parser "*"

or add

"nyx-solutions/yii2-nyx-user-agent-parser": "*"

to the require section of your composer.json file.

Usage

Statically

use nyx\components\http\userAgent\Parser;

$userAgent = UserAgentParser::parse(); // or UserAgentParser::parse($ua);

$userAgent->ua;                 // [Searched UserAgent]
$userAgent->successfullyParsed; // [Has UserAgent Results]
$userAgent->platform;           // [Detected Platform]
$userAgent->browser;            // [Detected Browser]
$userAgent->version;            // [Detected Browser Version]

As Object

use nyx\components\http\userAgent\Parser;

$userAgent = new UserAgentParser();

$userAgent->ua;                 // [Searched UserAgent]
$userAgent->successfullyParsed; // [Has UserAgent Results]
$userAgent->platform;           // [Detected Platform]
$userAgent->browser;            // [Detected Browser]
$userAgent->version;            // [Detected Browser Version]

Currently Detected Platforms

  • Desktop
    • Windows
    • Linux
    • Macintosh
    • Chrome OS
  • Mobile
    • Android
    • iPhone
    • iPad / iPod Touch
    • Windows Phone OS
    • Kindle
    • Kindle Fire
    • BlackBerry
    • Playbook
    • Tizen
  • Console
    • Nintendo 3DS
    • New Nintendo 3DS
    • Nintendo Wii
    • Nintendo WiiU
    • PlayStation 3
    • PlayStation 4
    • PlayStation Vita
    • Xbox 360
    • Xbox One

Currently Detected Browsers

  • Android Browser
  • BlackBerry Browser
  • Camino
  • Kindle / Silk
  • Firefox / Iceweasel
  • Safari
  • Internet Explorer
  • IEMobile
  • Chrome
  • Opera
  • Midori
  • Vivaldi
  • TizenBrowser
  • Lynx
  • Wget
  • Curl

License

yii2-nyx-user-agent-parser is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.

Yii2