PHPackages                             rilwanfit/yauaa-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rilwanfit/yauaa-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rilwanfit/yauaa-php
===================

Yet Another User Agent Analyzer – a PHP implementation

v1.1.0(1y ago)11.2k—0%MITPHPPHP ^8.0

Since Apr 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rilwanfit/yauaa-php)[ Packagist](https://packagist.org/packages/rilwanfit/yauaa-php)[ RSS](/packages/rilwanfit-yauaa-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

YAUAA-PHP
=========

[](#yauaa-php)

**Yet Another User Agent Analyzer – PHP Edition**
A lightweight and extensible PHP library for parsing and analyzing User-Agent strings, inspired by the original [YAUAA](https://github.com/nielsbasjes/yauaa) (Java).

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

---

🙏 Special Thanks
----------------

[](#-special-thanks)

This project is heavily inspired by the amazing work of [Niels Basjes](https://github.com/nielsbasjes), author of the original [Yet Another UserAgent Analyzer (YAUAA)](https://github.com/nielsbasjes/yauaa).
Without YAUAA, this PHP version wouldn't exist.

---

🚀 Features
----------

[](#-features)

- Detect browser (agent) name and version
- Detect layout engine \[ToDo\]
- Detect operating system and version \[ToDo\]
- Detect device class, brand, and name
- Basic bot detection support
- Pattern-driven and fully customizable (via YAML)
- No external dependencies required (except Symfony YAML parser)

---

🧰 Installation
--------------

[](#-installation)

```
composer require rilwanfit/yauaa-php
```

---

🧪 Example Usage
---------------

[](#-example-usage)

```
use Rilwanfit\YauaaPhp\Analyzer;

$analyzer = new Analyzer(__DIR__ . '/resources/patterns.yaml');

$result = $analyzer->analyze('Mozilla/5.0 Chrome/117.0.0.0 Safari/537.36');

print_r($result);

if ($analyzer->isMobile()) {
    echo "This is a mobile device.";
}

echo "Device class: " . $analyzer->getDeviceClass();
echo "Agent type: " . $analyzer->getAgentType();
```

---

📦 Custom Patterns
-----------------

[](#-custom-patterns)

Patterns are loaded from a YAML file (`resources/patterns.yaml`). Example format:

```
browsers:
  - name: "Chrome"
    class: "Browser"
    pattern: "~Chrome/(?[\\d\\.]+)~i"

os:
  - name: "Windows"
    class: "Operating System"
    pattern: "~Windows NT (?[\\d\\.]+)~i"

device:
  - name: "Desktop"
    class: "Desktop"
    pattern: "~Windows NT~i"
```

---

✅ Testing
---------

[](#-testing)

```
composer install
./vendor/bin/phpunit
```

---

🧱 Directory Structure
---------------------

[](#-directory-structure)

```
src/
  Analyzer.php

resources/
  patterns.yaml

tests/
  AnalyzerTest.php

```

---

📄 License
---------

[](#-license)

This project is licensed under the [MIT License](LICENSE).

---

👨‍💻 Author
----------

[](#‍-author)

Built by [Rilwan Fit](https://github.com/rilwanfit)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance49

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

378d ago

Major Versions

v0.0.3 → v1.0.02025-04-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/07e5fb5410ec925914bdaf72728984fbb9911a53391c2d85dae5097819139ed1?d=identicon)[rilwanfit](/maintainers/rilwanfit)

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/rilwanfit-yauaa-php/health.svg)

```
[![Health](https://phpackages.com/badges/rilwanfit-yauaa-php/health.svg)](https://phpackages.com/packages/rilwanfit-yauaa-php)
```

###  Alternatives

[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
