PHP code example of strukt / process
1. Go to this page and download the library: Download strukt/process library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
strukt / process example snippets
#!/usr/bin/env php
use Strukt\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();