strukt / process
Process execution
v1.1.0
2024-10-05 06:10 UTC
Requires
- php: ^8.1
- strukt/event: v1.1.0
This package is auto-updated.
Last update: 2025-01-05 06:45:47 UTC
README
PHP Process Execution
Installation
composer require strukt/process v1.0.1
Demo
#!/usr/bin/env php <?php use Strukt\Process; require 'vendor/autoload.php'; // $password = "p@55w0rd"; // $p = Process::run(["ls", "ls -al"]); // $p = Process::run(["read password ; echo \$password"], function(){ $ps = Process::run(["ping 127.0.0.1"], function($streamOutput){ echo $streamOutput; //wait 5 seconds before continuing // sleep(5); }); // $p = $ps->current(); // $p->write($password); // $p->closeInput(); // $error = $p->error(); // $output = $p->read();