Skip to content
Snippets Groups Projects

Issue #3282677: [DrupalCon] Automatic Updates beta test result

1 file
+ 12
3
Compare changes
  • Side-by-side
  • Inline
@@ -68,14 +68,23 @@ final class ProcessFactory implements ProcessFactoryInterface {
* {@inheritdoc}
*/
public function create(array $command): Process {
$php_dir = static::getPhpDirectory();
$is_composer = $this->isComposerCommand($command);
// If we're about to run a Composer command, execute it directly through the
// PHP interpreter we're using, rather than whatever is available globally.
if ($is_composer) {
array_unshift($command, $php_dir . DIRECTORY_SEPARATOR . 'php');
}
$process = $this->decorated->create($command);
$env = $process->getEnv();
if ($this->isComposerCommand($command)) {
if ($is_composer) {
$env['COMPOSER_HOME'] = $this->getComposerHomePath();
}
// Ensure that the PHP interpreter is in the PATH.
$env['PATH'] = $this->getEnv('PATH') . ':' . static::getPhpDirectory();
// Ensure that the PHP interpreter is in the PATH as well.
$env['PATH'] = $this->getEnv('PATH') . ":$php_dir";
return $process->setEnv($env);
}
Loading