For more information about the os-release standard, see https://www.freedesktop.org/software/systemd/man/os-release.html
This library will attempt to read and parse the two standard os-release information files, in order of precedence:
- /etc/os-release
- /usr/lib/os-release
If no file exists, or if the file cannot be read, an OsReleaseException will be thrown.
To install, use composer:
composer require compwright/php-os-release
use CompWright\PhpOsRelease\OsReleaseReader;
$reader = new OsReleaseReader();
$osRelease = $reader();
// Access via property or array access
$version = $osRelease->version;
// or:
$version = $osRelease['VERSION'];$ make testPlease see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.