Simple php command executor with param binding.
Via Composer
$ composer require pastuhov/php-exec-command
- light weight
- param binding
- throws an exception if return status >0
$output = Command::exec(
'echo {phrase}',
[
'phrase' => 'hello'
]
);
// $output = 'hello'
or
$output = Command::exec(
'echo {phrase}',
[
'phrase' => [
'hello',
'world'
]
]
);
// $output = 'hello world'
or
try {
Command::exec('locate {parody}',
[
'parody' => [
'pink_unicorn'
]
]
);
echo 'unicorn's was found!';
} catch (\Exception $e) {
echo 'cant find unicorn (';
}
$ composer test
or
$ phpunit
If you discover any security related issues, please email kirill@pastukhov.su instead of using the issue tracker.
GNU General Public License, version 2. Please see License File for more information.