PHPackages                             opawg/user-agents-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. opawg/user-agents-php

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

opawg/user-agents-php
=====================

PHP implementation for opawg/user-agents.

v1.0(5y ago)24.2k1MITPHP

Since Nov 28Pushed 4y agoCompare

[ Source](https://github.com/opawg/user-agents-php)[ Packagist](https://packagist.org/packages/opawg/user-agents-php)[ Docs](https://github.com/opawg/user-agents-php)[ RSS](/packages/opawg-user-agents-php/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

user-agents-php
===============

[](#user-agents-php)

This is a dummy PHP implementation for both [opawg/user-agents](https://github.com/opawg/user-agents) and [opawg/podcast-rss-useragents](https://github.com/opawg/podcast-rss-useragents)

Installation
------------

[](#installation)

### Via composer

[](#via-composer)

- Add `opawg/user-agents-php` to your `composer.json`.
- Add `post-install-cmd` / `post-update-cmd` scripts to your `composer.json` so that the class is generated.

```
{
  "require": {
    "opawg/user-agents-php": "*"
  },
  "scripts": {
    "post-install-cmd": [
      "@php vendor/opawg/user-agents-php/src/UserAgentsGenerate.php >  vendor/opawg/user-agents-php/src/UserAgents.php",
      "@php vendor/opawg/user-agents-php/src/UserAgentsRSSGenerate.php >  vendor/opawg/user-agents-php/src/UserAgentsRSS.php"
    ],
    "post-update-cmd": [
      "@php vendor/opawg/user-agents-php/src/UserAgentsGenerate.php >  vendor/opawg/user-agents-php/src/UserAgents.php",
      "@php vendor/opawg/user-agents-php/src/UserAgentsRSSGenerate.php >  vendor/opawg/user-agents-php/src/UserAgentsRSS.php"
    ]
  }
}

```

### Manually

[](#manually)

- Clone git repository where you need it:

```
$ git clone https://github.com/opawg/user-agents-php.git

```

- Generate the classes:

```
$ php src/UserAgentsGenerate.php >  src/UserAgents.php
$ php src/UserAgentsRSSGenerate.php >  src/UserAgentsRSS.php

```

Or with composer:

```
$ composer run-script post-install-cmd

```

Usage
-----

[](#usage)

When you need it, just call `\Opawg\UserAgentsPhp\UserAgents::find()` for audio files or `\Opawg\UserAgentsPhp\UserAgentsRSS::find()` for RSS feed:

```
$player = \Opawg\UserAgentsPhp\UserAgents::find($_SERVER['HTTP_USER_AGENT']);
if($player){
	print player['app']."\n";
	print player['device']."\n";
	print player['os']."\n";
	print player['bot']."\n";
} else {
	print "This user-agent was not found.\n";
}

$service = \Opawg\UserAgentsPhp\UserAgentsRSS::find($_SERVER['HTTP_USER_AGENT']);
if($player){
	print service['name']."\n";
	print service['slug']."\n";
	print service['url']."\n";
} else {
	print "This user-agent was not found.\n";
}

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

2043d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1984208?v=4)[Benjamin Bellamy](/maintainers/benjaminbellamy)[@benjaminbellamy](https://github.com/benjaminbellamy)

---

Top Contributors

[![benjaminbellamy](https://avatars.githubusercontent.com/u/1984208?v=4)](https://github.com/benjaminbellamy "benjaminbellamy (25 commits)")

### Embed Badge

![Health badge](/badges/opawg-user-agents-php/health.svg)

```
[![Health](https://phpackages.com/badges/opawg-user-agents-php/health.svg)](https://phpackages.com/packages/opawg-user-agents-php)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k430.4M1.7k](/packages/nette-utils)[dgr/nohup

A library to run a command in the background, it will return the process's pid, and get it's is running status anytime in the another process, and can be stoped anytime. It support Windows, Linux and Mac osx.

531.7k](/packages/dgr-nohup)

PHPackages © 2026

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