Exemplo n.º 1
0
 /**
  * Build the internal process builder.
  *
  * @param array $arguments The arguments.
  *
  * @return ProcessBuilder
  */
 private function buildInternal(array $arguments)
 {
     $builder = ProcessBuilder::create($this->config->getPhpCliBinary());
     if (null !== ($cliArguments = $this->config->getPhpCliArguments())) {
         $builder->addArguments($cliArguments);
     }
     $builder->addArguments($arguments);
     if (null !== ($environment = $this->config->getPhpCliEnvironment())) {
         foreach ($environment as $name => $value) {
             $builder->setEnv($name, $value);
         }
     }
     // MUST be kept last.
     $builder->setEnv('COMPOSER', $this->homePath . DIRECTORY_SEPARATOR . 'composer.json');
     return $builder;
 }
Exemplo n.º 2
0
 /**
  * Test force background
  *
  * @return void
  */
 public function testShouldForceBackground()
 {
     $process = ProcessBuilder::create('/bin/foo')->setForceBackground(false)->setForceBackground()->generate();
     if ('\\' === DIRECTORY_SEPARATOR) {
         $this->assertStringStartsWith('start /B ', $process->getCommandLine());
     } else {
         $this->assertStringEndsWith(' &', $process->getCommandLine());
     }
 }