2017 © Pedro Peláez
 

library php-exec

image

tomaszdurka/php-exec

  • Saturday, September 20, 2014
  • by tomaszdurka
  • Repository
  • 0 Watchers
  • 2 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

PhpExec

Super-simple library for executing shell commands in php. I have created it without knowledge of already mature (fulfiling my needs) library https://github.com/symfony/Process, (*1)

Installation

Use composer:, (*2)

{
  "require": {
    "tomaszdurka/php-exec": "~0.1.0"
  }
}

Code usage

$command = new Command('ls');
$result = $command->run();

$result->isSuccess();
$result->getOutput();
$result->getExitCode();
$result->getErrorOutput();

Events

Apart from basic usage you can listen to intercept specific Command events. All possible events are listed in example below:, (*3)

$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();

The Versions

20/09 2014

dev-master

9999999-dev

  Sources   Download

The Requires

 

The Development Requires

16/09 2014
10/09 2014