コード例 #1
0
ファイル: UtilsTest.php プロジェクト: anley/croon
 public function testExec()
 {
     $dir = getcwd();
     Utils::exec('pwd', $stdout, $stderr);
     $this->assertEquals($dir, trim($stdout));
 }
コード例 #2
0
ファイル: Croon.php プロジェクト: anley/croon
 /**
  * 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));
     });
 }