Example #1
0
 public static function yeah($cmd, $block, $cwd = null, $env = null)
 {
     if (!is_callable($block)) {
         throw new YeahException("block is not callable");
     }
     $p = new self($cmd, $cwd, $env);
     $block($p->pid(), $p->stdin(), $p->stdout(), $p->stderr());
     return $p->close();
 }