cyberline / systemd-state
PHP Systemd State Parser
v1.1.0
2019-02-27 13:34 UTC
Requires
- php: >=7.1
- ext-json: *
Requires (Dev)
- pdepend/pdepend: @stable
- phploc/phploc: *
- phpmd/phpmd: @stable
- phpunit/phpunit: ^7
- sebastian/phpcpd: *
- squizlabs/php_codesniffer: @stable
This package is auto-updated.
Last update: 2024-11-08 08:09:59 UTC
README
This package provides an object oriented way to access your systemd service state.
Tested Versions
- Ubuntu: systemd 229
- Debian: systemd 215,232
- CentOS: systemd 219
Usage
composer require cyberline/systemd-state
# get info about systemd itself:
$systemdState = new SystemdState;
$info = $systemdState->getSystemdInfo();
...
# get info about specific services:
$systemdState = new SystemdState;
$systemdState
->addCheckUnit('nginx');
->addCheckUnit('redis');
$info = $systemdState->getReport();
...
# get info from pregenerated file
# /bin/systemctl show * --no-pager > systemd.txt
$systemdState = new SystemdState;
$info = $systemdState
->checkFromString(file_get_contents('systemd.txt'))
->getReport();
...
# get info about all services:
$systemdState = new SystemdState;
$systemdState->addAllUnits();
$info = $systemdState->getReport();