Execute commands and external programs
Warning
This project is not finished yet, work in progress.
You can install the package via composer:
composer require ghostwriter/shell
You can also star (🌟) this repo to find it easier later.
$shell = Shell::new();
$shell->execute('cd', [sys_get_temp_dir()]);
$result = $shell->execute(PHP_BINARY, ['-r', 'echo "#BlackLivesMatter";']);
$exitCode = $result->exitCode(); // 0
if ($exitCode !== 0) {
throw new RuntimeException($result->stderr());
}
if ($exitCode === 0) {
echo $result->stdout(); // "#BlackLivesMatter"
}
Please see CHANGELOG.md for more information on what has changed recently.
Please see LICENSE for more information on the license that applies to this project.
Please see SECURITY.md for more information on security disclosure process.