2017 © Pedro Peláez
 

library util-useragentparser

image

fam/util-useragentparser

  • Thursday, April 20, 2017
  • by three-quarters-stroke
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Fam UserAgentParser

Fam UserAgentParser is a lightweight and fast browser detector. It determines the operating system, web client name and web client version., (*1)


Scrutinizer Code Quality build status for Fam Code Coverage, (*2)


Installing

You can install Fam UserAgentParser with composer. To install Fam UserAgentParser with composer just execute the following command:, (*3)

composer require fam/util-useragentparser

Getting started

$userAgent = UserAgentParser::createInstance()->parseUserAgent($_SERVER['HTTP_USER_AGENT']);

if ($userAgent->isWebClient('firefox')) {
    if ($userAgent->isWebClientVersionBetween(9.5, 9.6)) {
       echo 'firefox between 95 and 96';
    }
    else if ($userAgent->isWebClientVersionBetween(9.2, 9.4)) {
       echo 'firefox between 92 and 94';
    }
}

if ($userAgent->isOs('macintosh')) {
   echo 'Mac';
}

The Versions

20/04 2017

dev-master

9999999-dev

  Sources   Download

Apache-2.0

The Requires

  • php ^7.1

 

The Development Requires