PHP code example of tomaszdurka / php-exec
1. Go to this page and download the library: Download tomaszdurka/php-exec 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/ */
tomaszdurka / php-exec example snippets
$command = new Command('ls');
$result = $command->run();
$result->isSuccess();
$result->getOutput();
$result->getExitCode();
$result->getErrorOutput();
$command = new Command('ls');
$command->on('start', function($pid) {
});
$command->on('stdout', function($output) {
});
$command->on('stderr', function($error) {
});
$command->on('stop', function($exitCode) {
});
$command->run();