The Universal Device Detection library that parses User Agents and Browser Client Hints to detect devices (desktop, tablet, mobile, tv, cars, console,

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-11-27 20:30:12

The Universal Device Detection library that parses User Agents and Browser Client Hints to detect devices (desktop, tablet, mobile, tv, cars, console, etc.), clients (browsers, feed readers, media players, PIMs, ...), operating systems, brands and models.

Instead of using the full power of DeviceDetector it might in some cases be better to use only specific parsers. If you aim to check if a given useragent is a bot and don't require any of the other information, you can directly use the bot parser.

Alternatively to using composer you can also use the included autoload.php. This script will register an autoloader to dynamically load all classes in DeviceDetector namespace.

Device Detector requires a YAML parser. By default Spyc parser is used. As this library is not included you need to include it manually or use another YAML parser.

Sometimes it may be useful to generate the list of most used user agents on your website, extracting this list from your access logs using the following command:

Leave a Comment