2017 © Pedro Peláez
 

library yeah

image

cloudmario/yeah

  • Tuesday, August 25, 2015
  • by CloudSide
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yeah

Latest Stable Version Latest Stable Version Total Downloads License, (*1)

Execute a command and provides a much greater degree of control over the program execution., (*2)

Requirements

  • PHP >= 5.3.0

Introduction

use composer composer.json:, (*3)

"require": {
    "cloudmario/yeah": "dev-master"
}

Usage

  • Simple
$p = new Yeah("/bin/bash");
list($pid, $stdin, $stdout, $stderr) = array($p->pid(), $p->stdin(), $p->stdout(), $p->stderr());

fwrite($stdin, "echo 42.out\n");
fwrite($stdin, "echo 42.err 1>&2\n");
fclose($stdin);

echo "pid    : " . $pid."\n";
echo "stdout : " . trim(fread($stdout, 1024)) . "\n";
echo "stderr : " . trim(fread($stderr, 1024)) . "\n";
echo "status : " . trim(print_r($p->status(), true)) . "\n";
  • Block
$status = Yeah::yeah("/bin/bash", function($pid, $stdin, $stdout, $stderr) {

    fwrite($stdin, "echo 42.out\n");
    fwrite($stdin, "echo 42.err 1>&2\n");
    fclose($stdin);

    echo "pid    : " . $pid . "\n";
    echo "stdout : " . trim(fread($stdout, 1024)) . "\n";
    echo "stderr : " . trim(fread($stderr, 1024)) . "\n";

    /*
    while ( !feof($stdout) ) {
        $out .= fgets($stdout, 2048);
    }
    */

});

echo "status : " . trim(print_r($status, true)) . "\n";

, (*4)

The Versions

25/08 2015

dev-master

9999999-dev https://github.com/CloudSide/yeah

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cloud popen yeah

19/08 2015

1.0.0

1.0.0.0 https://github.com/CloudSide/yeah

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cloud popen yeah