2017 © Pedro Peláez
 

library ua-result

Library for PHP 5.6+ to handle useragent parser results

image

mimmi20/ua-result

Library for PHP 5.6+ to handle useragent parser results

  • Thursday, April 5, 2018
  • by mimmi20
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10,913 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 42 Versions
  • 7 % Grown

The README.md

Useragent Detector Result

Latest Stable Version Latest Unstable Version License, (*1)

Code Status

codecov Average time to resolve an issue Percentage of issues still open, (*2)

Description

This library provides a set of classes representing a result of an useragent detection., (*3)

Requirements

This library requires PHP 7.4+. Also a PSR-3 compatible logger is required., (*4)

Installation

Run the command below to install via Composer, (*5)

composer require mimmi20/ua-result

The result object

The result object is the main object and contains only other objects., (*6)

The browser object

The browser object represents the detected browser., (*7)

// 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();

The engine object

The engine object represents the detected rendering engine., (*8)

// 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();

The device object

The device object represents the detected device., (*9)

// 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();

The platform object

The os object represents the detected platform., (*10)

// 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();

Issues and feature requests

Please report your issues and ask for new features on the GitHub Issue Tracker at https://github.com/mimmi20/ua-result/issues, (*11)

The Versions

27/02 2016

2.0.0-alpha

2.0.0.0-alpha https://github.com/mimmi20/ua-result

Library for PHP 5.6+ to handle useragent parser results

  Sources   Download

MIT

The Requires

 

The Development Requires

parser http browser user agent user-agent

05/12 2015

1.1.0

1.1.0.0 https://github.com/mimmi20/ua-result

Library for PHP 5.6+ to handle useragent parser results

  Sources   Download

MIT

The Requires

 

The Development Requires

parser http browser user agent user-agent

17/10 2015

1.0.6

1.0.6.0 https://github.com/mimmi20/ua-result

Library for PHP 5.5+ to handle useragent parser results

  Sources   Download

MIT

The Requires

 

The Development Requires

parser http browser user agent user-agent

16/10 2015

1.0.5

1.0.5.0 https://github.com/mimmi20/ua-result

Library for PHP 5.5+ to handle useragent parser results

  Sources   Download

MIT

The Requires

 

The Development Requires

parser http browser user agent user-agent

16/10 2015

1.0.4

1.0.4.0 https://github.com/mimmi20/ua-result

Library for PHP 5.5+ to handle useragent parser results

  Sources   Download

MIT

The Requires

 

The Development Requires

parser http browser user agent user-agent

15/10 2015

1.0.3

1.0.3.0 https://github.com/mimmi20/ua-result

Library for PHP 5.5+ to handle useragent parser results

  Sources   Download

MIT

The Requires

 

The Development Requires

parser http browser user agent user-agent

15/10 2015

1.0.2

1.0.2.0 https://github.com/mimmi20/ua-result

Library for PHP 5.5+ to handle useragent parser results

  Sources   Download

MIT

The Requires

 

The Development Requires

parser http browser user agent user-agent

15/10 2015

1.0.1

1.0.1.0 https://github.com/mimmi20/ua-result

Library for PHP 5.5+ to handle useragent parser results

  Sources   Download

MIT

The Requires

 

The Development Requires

parser http browser user agent user-agent

11/10 2015

1.0.0

1.0.0.0 https://github.com/mimmi20/ua-result

Library for PHP 5.5+ to handle useragent parser results

  Sources   Download

MIT

The Requires

 

The Development Requires

parser http browser user agent user-agent