/** * Run the queue fetching process. * @param string $command The command. * @param string $cwd The working directory. * @param integer $timeout The timeout. * @param array $env The environment to be passed. * @return void */ protected function runQueueFetching($command, $cwd = null, $timeout = null, array $env = []) { $process = new \Symfony\Component\Process\Process($command, isset($cwd) ? $cwd : getcwd(), $env, null, $timeout); $process->setTimeout($timeout); $process->setIdleTimeout(null); $process->run(); if ($process->isSuccessful()) { //TODO logging. $this->stdout($process->getOutput() . PHP_EOL); $this->stdout($process->getErrorOutput() . PHP_EOL); } else { //TODO logging. $this->stdout($process->getOutput() . PHP_EOL); $this->stdout($process->getErrorOutput() . PHP_EOL); } }