jnjxp/xcmd

Simple external command runner

0.1.0 2016-10-23 16:56 UTC

README

Simple external command runner. Basically just a proc_open wrapper;

Latest version Build Status Coverage Status Quality Score

Installation

composer require jnjxp/xcmd

Usage

use Jnjxp\Xcmd\ExternalCommand;

$cmd = new ExternalCommand('elinks -dump -dump-color-mode 1');
$payload = $cmd($response->getBody()); // write input to stdin

if ($payload->isError()) {
    foreach ($payload->getMessages() as $error) {
        echo $error . "\n";
    }
    exit($payload->getStatus())
}

echo $payload;