PHP code example of hypnopompia / process
1. Go to this page and download the library: Download hypnopompia/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/ */
hypnopompia / process example snippets
ypnopompia\Process;
$process = Process::factory("./scripts/simple.sh");
$process->start()->join()->stop(); // Start the process and wait for it to end, then cleanup
extract($process->getOutput());
echo "Process Id: " . $process->getPid() . "\n";
echo "STDOUT: " . $stdout . "\n";
echo "STDERR: " . $stderr . "\n";
echo "Exit code: " . $process->getExitcode() . "\n";