No description, website, or topics provided.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
spec/Task/Plugin
src
tests/src/Process
.coveralls.yml
.gitignore
.travis.yml
README.md
Taskfile
composer.json

README.md

task/process

Build Status Coverage Status

Installation

Install via Composer:

...
    "require-dev": {
        "task/process": "~0.2"
    }
...

Usage

Inject into the project container:

use Task\Plugin\ProcessPlugin;

$project->inject(function ($container) {
    $container['ps'] = new ProcessPlugin;
});

$project->addTask('whoami', ['ps', function ($ps) {
    $ps->run('whoami')->pipe($this->getOutput());
}]);

API

run($command, array $args = [], $cwd = null, array $env = [], OutputInterface $output = null)

$command - The command run:

run('whoami');

array $args = [] - An array of command line arguments:

run('ls', ['-la']);

$cwd = null - The directory to execute the command in:

run('du', ['-hs'], '/path/to/my/project');

$env - An array of environment variables:

run('myscript', [], null, ['DEBUG' => 1]);
build($command, array $args = [])

Accepts the same $command and $args arguments as run, but returns an instance of Task\Plugin\Process\ProcessBuilder, which thinly wraps Symfony's ProcessBuilder, providing an OO interface to confguration a command.