ghostwriter / shell
Execute commands and external programs
Maintainers
Details
Fund package maintenance!
ghostwriter
Installs: 217 226
Dependents: 8
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=8.3
Requires (Dev)
- ghostwriter/coding-standard: dev-main
README
Execute commands and external programs
Warning
This project is not finished yet, work in progress.
Installation
You can install the package via composer:
composer require ghostwriter/shell
Star ⭐️ this repo if you find it useful
You can also star (🌟) this repo to find it easier later.
Usage
$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" }
Credits
Changelog
Please see CHANGELOG.md for more information on what has changed recently.
License
Please see LICENSE for more information on the license that applies to this project.
Security
Please see SECURITY.md for more information on security disclosure process.