PHPackages                             compwright/php-os-release - 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. compwright/php-os-release

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

compwright/php-os-release
=========================

FreeDesktop.org os-release file reader for PHP

v1.0.0(9mo ago)02.2k—8.3%MITPHPPHP ^8.3CI passing

Since Aug 5Pushed 9mo agoCompare

[ Source](https://github.com/compwright/php-os-release)[ Packagist](https://packagist.org/packages/compwright/php-os-release)[ GitHub Sponsors](https://github.com/compwright)[ RSS](/packages/compwright-php-os-release/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

FreeDesktop.org os-release file reader for PHP
==============================================

[](#freedesktoporg-os-release-file-reader-for-php)

[![Latest Version](https://camo.githubusercontent.com/ca2708339380fe1a3e3bf6e9c80fac7555816c86c33ffd67f55f64de23990be3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f636f6d707772696768742f7068702d6f732d72656c656173652e7376673f7374796c653d666c61742d737175617265)](https://github.com/compwright/php-os-release/releases)[![Total Downloads](https://camo.githubusercontent.com/42bb9daf9225b3a06522ec9e67a8dfd085ce475c8dc8908e11f7dce2b1f62f7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6d707772696768742f7068702d6f732d72656c656173652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/compwright/php-os-release)

For more information about the os-release standard, see

This library will attempt to read and parse the two standard os-release information files, in order of precedence:

1. /etc/os-release
2. /usr/lib/os-release

If no file exists, or if the file cannot be read, an OsReleaseException will be thrown.

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

[](#installation)

To install, use composer:

```
composer require compwright/php-os-release

```

Usage
-----

[](#usage)

```
use CompWright\PhpOsRelease\OsReleaseReader;

$reader = new OsReleaseReader();
$osRelease = $reader();

// Access via property or array access
$version = $osRelease->version;

// or:
$version = $osRelease['VERSION'];
```

Testing
-------

[](#testing)

```
$ make test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/compwright/php-os-release/blob/master/CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/compwright/php-os-release/blob/master/LICENSE) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance57

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

286d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/138688?v=4)[Jonathon Hill](/maintainers/compwright)[@compwright](https://github.com/compwright)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

freedesktoplinuxos-release

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/compwright-php-os-release/health.svg)

```
[![Health](https://phpackages.com/badges/compwright-php-os-release/health.svg)](https://phpackages.com/packages/compwright-php-os-release)
```

###  Alternatives

[spatie/laravel-settings

Store your application settings

1.5k5.9M72](/packages/spatie-laravel-settings)[theseer/phpdox

A fast Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT) with event based processing

6012.4M145](/packages/theseer-phpdox)[ynacorp/nova-swatches

A beautiful color picking field for Laravel Nova.

22291.8k1](/packages/ynacorp-nova-swatches)[brickrouge/brickrouge

A toolkit to create HTML elements

301.8k6](/packages/brickrouge-brickrouge)

PHPackages © 2026

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