/** * Retrieve the command line environment variables to use. * * @return array */ private function getEnvironment() { $variables = $this->getDefinedEnvironmentVariables(); if (null === ($environment = $this->config->getPhpCliEnvironment())) { return $variables; } $variables = array_merge($variables, $environment); return $variables; }
/** * 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; }