nox-it/yii2-nox-user-agent-parser

This package is abandoned and no longer maintained. No replacement package was suggested.

Yii2 UserAgent Parser

2.0.0 2020-05-03 15:25 UTC

This package is auto-updated.

Last update: 2022-06-01 20:12:08 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