public function run() { $configFile = tempnam(sys_get_temp_dir(), 'satis-admin'); file_put_contents($configFile, $this->manager->getJson()); $process = ProcessBuilder::create(['php', $this->binDir . '/satis', 'build', $configFile, $this->outputDir])->getProcess(); $this->logger->addInfo('Building config...', ['command-line' => $process->getCommandLine()]); if (0 === $process->run()) { $this->logger->addInfo('Config built.'); } else { $this->logger->addError('Config not build', ['stdout' => $process->getOutput(), 'stderr' => $process->getErrorOutput()]); } }
public function run() { $configFile = tempnam($this->cacheDir . '/satis', 'satis-admin'); file_put_contents($configFile, $this->manager->getJson()); $process = ProcessBuilder::create(['php', $this->binDir . '/satis', 'build', $configFile, $this->outputDir])->setTimeout(null)->addEnvironmentVariables(['HOME' => $this->cacheDir])->getProcess(); $this->logger->addInfo('Building config...', ['command-line' => $process->getCommandLine()]); if (0 === $process->run()) { unlink($configFile); $this->logger->addInfo('Config built.'); } else { $this->logger->addError('Config not build', ['stdout' => $process->getOutput(), 'stderr' => $process->getErrorOutput()]); } }