decodelabs / systemic
Easy access to system and environment info
Installs: 16 193
Dependents: 4
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- ext-intl: *
- decodelabs/archetype: ^0.3
- decodelabs/coercion: ^0.2
- decodelabs/deliverance: ^0.2.9
- decodelabs/eventful: ^0.3.4
- decodelabs/exceptional: ^0.4
- decodelabs/fluidity: ^0.3
- decodelabs/glitch-support: ^0.4
- decodelabs/veneer: ^0.11.6
- symfony/polyfill-mbstring: ^1.7
Requires (Dev)
- dev-develop / 0.11.x-dev
- v0.11.14
- v0.11.13
- v0.11.12
- v0.11.11
- v0.11.10
- v0.11.9
- v0.11.8
- v0.11.7
- v0.11.6
- v0.11.5
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.5
- v0.10.4
- v0.10.3
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.7
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.1
- v0.7.0
- v0.6.13
- v0.6.12
- v0.6.11
- v0.6.10
- v0.6.9
- v0.6.8
- v0.6.7
- v0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- dev-main
This package is auto-updated.
Last update: 2024-11-04 21:51:11 UTC
README
System processes and information at your fingertips
Systemic offers an easy to use frontend to launching and controlling processes and accessing system information.
Get news and updates on the DecodeLabs blog.
Installation
Install via composer:
composer require decodelabs/systemic
Usage
Importing
Systemic uses Veneer to provide a unified frontage under DecodeLabs\Systemic
.
You can access all the primary functionality via this static frontage without compromising testing and dependency injection.
Process launching
Launch new processes:
use DecodeLabs\Systemic; $dir = 'path/to/working-directory'; // Launch and capture output of a process echo Systemic::capture(['ls', '-al'], $dir)->getOutput(); // Launch and capture output of a process with raw string command (not escaped) echo Systemic::capture('ls -al', $dir)->getOutput(); // Launch and capture output of a script echo Systemic::capture(['myPhpScript.php'], $dir)->getOutput(); // Launch a background task $process = Systemic::launch(['make', 'install']); // Launch a background script $process = Systemic::launchScript(['myPhpScript.php'], $dir); // Run a piped pseudo terminal process $success = Systemic::run(['interactive-app', '--arg1'], $dir); // Run a piped pseudo terminal script $success = Systemic::runScript(['myPhpScript.php', '--arg1'], $dir); // Custom escaped command $success = Systemic::command(['escaped', 'arguments']) ->setWorkingDirectory($dir) ->addSignal('SIGSTOP') // Pass SIGSTOP through when caught ->setUser('someuser') // Attempt to use sudo to run as user ->run(); // Custom raw command with env arguments $result = Systemic::command('echo ${:VARIABLE} | unescaped-command', [ 'VARIABLE' => 'Hello world' ]) ->setWorkingDirectory($dir) ->capture();
OS info
Get information about the current OS:
use DecodeLabs\Systemic; // OS info echo Systemic::$os->getName(); // Linux | Windows | Darwin echo Systemic::$os->getPlatformType(); // Unix | Windows echo Systemic::$os->getDistribution(); // eg Ubuntu or High Sierra, etc echo Systemic::$os->getVersion(); // System version info echo Systemic::$os->getRelease(); // System version number echo Systemic::$os->getHostName(); // System hostname // Find binaries on the system echo Systemic::$os->which('php'); // eg /usr/local/bin/php
Windows
Please note, OS and Process support on Windows is currently extremely sketchy - this will be fleshed out soon!
Locale & Timezone
Looking for Locale and Timezone info? This has moved to Cosmos.
Licensing
Systemic is licensed under the MIT License. See LICENSE for the full license text.