All Projects → ua-parser → Uap Php

ua-parser / Uap Php

Licence: other
PHP implementation of ua-parser

Labels

Projects that are alternatives of or similar to Uap Php

Jquery.scrollto
Lightweight, cross-browser and highly customizable animated scrolling with jQuery
Stars: ✭ 3,609 (+809.07%)
Mutual labels:  browser
React Uploady
Modern file uploading - components & hooks for React
Stars: ✭ 372 (-6.3%)
Mutual labels:  browser
Js Dos
The best API for running dos programs in browser
Stars: ✭ 385 (-3.02%)
Mutual labels:  browser
Lynket Browser
🌐 A better browser for Android using the Custom Tab protocol. Previously called Chromer.
Stars: ✭ 364 (-8.31%)
Mutual labels:  browser
Undetected Chromedriver
Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
Stars: ✭ 365 (-8.06%)
Mutual labels:  browser
Fuzzdata
Fuzzing resources for feeding various fuzzers with input. 🔧
Stars: ✭ 376 (-5.29%)
Mutual labels:  browser
Theheadless.dev
🪖 Learn Puppeteer and Playwright - Tips, tricks and in-depth guides from the trenches.
Stars: ✭ 360 (-9.32%)
Mutual labels:  browser
Karin
An elegant promise based HTTP client for the browser and node.js [WIP]
Stars: ✭ 393 (-1.01%)
Mutual labels:  browser
Agent
👮 A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect
Stars: ✭ 3,891 (+880.1%)
Mutual labels:  browser
Snazzy
Format JavaScript Standard Style as Stylish (i.e. snazzy) output
Stars: ✭ 381 (-4.03%)
Mutual labels:  browser
Open Browser.vim
Open URI with your favorite browser from your most favorite editor
Stars: ✭ 364 (-8.31%)
Mutual labels:  browser
Webcatalog App
Official WebCatalog app.
Stars: ✭ 369 (-7.05%)
Mutual labels:  browser
Nightmare
A high-level browser automation library.
Stars: ✭ 19,067 (+4702.77%)
Mutual labels:  browser
Uxp
This is a GitHub mirror of the Unified XUL Platform. The main repository can be found at https://repo.palemoon.org/MoonchildProductions/UXP/
Stars: ✭ 363 (-8.56%)
Mutual labels:  browser
Filer
Node-like file system for browsers
Stars: ✭ 389 (-2.02%)
Mutual labels:  browser
Upchain Wallet
以太坊钱包(支持DApp 浏览器)- A Powerful Ethereum Android Wallet & DApp Browser
Stars: ✭ 359 (-9.57%)
Mutual labels:  browser
Kotlin Result
A multiplatform Result monad for modelling success or failure operations.
Stars: ✭ 369 (-7.05%)
Mutual labels:  browser
Pdfjs
A Portable Document Format (PDF) generation library targeting both the server- and client-side.
Stars: ✭ 395 (-0.5%)
Mutual labels:  browser
Webrunlocal
PluginOK(牛插)中间件是一个实现网页浏览器(Web Browser)与本地程序(Local App)之间进行双向调用的低成本、强兼容、安全可控、轻量级、易集成、可扩展、跨浏览器的原生小程序系统。通过此中间件可实现网页前端JS脚本无障碍操作本地电脑各种硬件、调用本地系统API及相关组件功能,可彻底解决DLL模块、ActiveX控件及自动化程序(如微软Office、金山WPS、AutoCAD等)在Chrome、Edge、360、FireFox、IE、Opera、QQ、搜狗等浏览器各版本中的嵌入使用问题,媲美原Java Applet的效果
Stars: ✭ 391 (-1.51%)
Mutual labels:  browser
Servo
The Servo Browser Engine
Stars: ✭ 20,469 (+5055.92%)
Mutual labels:  browser

ua-parser PHP Library

Gitter Build Status Average time to resolve an issue Percentage of issues still open Latest Stable Version Total Downloads License

This is the PHP library for the uap-core project.

Installation

Add ua-parser/uap-php to the require section of your composer.json file and run composer update.

Usage

Straightforward:

require_once 'vendor/autoload.php';
use UAParser\Parser;

$ua = "Mozilla/5.0 (Macintosh; Intel Ma...";

$parser = Parser::create();
$result = $parser->parse($ua);

print $result->ua->family;            // Safari
print $result->ua->major;             // 6
print $result->ua->minor;             // 0
print $result->ua->patch;             // 2
print $result->ua->toString();        // Safari 6.0.2
print $result->ua->toVersion();       // 6.0.2

print $result->os->family;            // Mac OS X
print $result->os->major;             // 10
print $result->os->minor;             // 7
print $result->os->patch;             // 5
print $result->os->patchMinor;        // [null]
print $result->os->toString();        // Mac OS X 10.7.5
print $result->os->toVersion();       // 10.7.5

print $result->device->family;        // Other

print $result->toString();            // Safari 6.0.2/Mac OS X 10.7.5
print $result->originalUserAgent;     // Mozilla/5.0 (Macintosh; Intel Ma...

Using Your Own Custom regexes.php File

You can use your own regexes.php file if you've customized the official file. I strongly encourage you to push back any changes you may have so others can benefit. That said, to use your own do the following:

require_once 'vendor/autoload.php';
use UAParser\Parser;

$parser = Parser::create("path/to/custom/regexes.php");

Using ua-parser PHP Library from the Command Line

A command line utility is now included with the PHP library. The following commands are supported:

Get Usage Info

Provides simple usage information:

php bin/uaparser

Update the regexes.php File

Fetches an updated YAML file for ua-parser and overwrites the current regexes.php file. You can use the following as part of a cron job that runs nightly.

php bin/uaparser ua-parser:update [--no-backup]

By default creates a backup file. Use --no-backup to turn that feature off.

Convert an Existing regexes.yaml File to regexes.php

With the change to v2.0 you may have an existing and customized YAML file for ua-parser. Use the following to convert it to JSON.

php bin/uaparser ua-parser:convert [file]

Grab Just the Latest regexes.yaml File From the Repository

If you need to add a new UA it's easier to edit the original YAML and then convert it to JSON.

php bin/uaparser ua-parser:fetch [file]

Fetches an updated YAML file. Warning: This method overwrites any existing regexes.yaml file.

Parse a Single User Agent String

Parses a user agent string and dumps the results as a list.

php bin/uaparser ua-parser:parse "your user agent string"

Parse a Webserver Log File

Parses the supplied log file or log directory to test ua-parser. Saves the UA to a file when the UA or OS family aren't recognized or when the UA is listed as a generic smartphone or as a generic feature phone.

php bin/uaparser ua-parser:logfile [-f /path/to/logfile] [-d /path/to/logdir] [--include "*.gz"] [--exclude "*.gz"] errors.log

Multiple --include and --exclude parameters are allowed.

Credits

Thanks to the original ua-parser team for making the YAML file available for others to build upon.

Also, many thanks to the following major contributors to the PHP library:

  • Bryan Shelton
  • Michael Bond
  • @rjd22
  • Timo Tijhof
  • Marcus Bointon
  • Ryan Parman
  • Pravin Dahal

Licensing

  • The library is licensed under the MIT license
  • The user agents data from the ua-parser project is licensed under the Apache license
  • The initial list of generic feature phones & smartphones came from Mobile Web OSP under the MIT license
  • The initial list of spiders was taken from Yiibu's profile project under the MIT license.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].