Author: Yohan Giarelli (yohan@frequence-web.fr)
Example #1
0
 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()]);
     }
 }
Example #2
0
 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()]);
     }
 }