public function testExec() { $dir = getcwd(); Utils::exec('pwd', $stdout, $stderr); $this->assertEquals($dir, trim($stdout)); }
/** * Dispatch command * * @param $command */ protected function dispatch($command) { $this->logger->info('Execute (%s)', $command); $this->emit('execute', $command); $that = $this; $this->process->parallel(function () use($command, $that) { $status = Utils::exec($command, $stdout, $stderr); $that->logger->info('Finish (%s)[%d]', $command, (int) $status); $that->emit('executed', $command, array($status, $stdout, $stderr)); }); }