Skip to content
Snippets Groups Projects

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

Files
10
@@ -68,23 +68,15 @@ 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 ($is_composer) {
if ($this->isComposerCommand($command)) {
$env['COMPOSER_HOME'] = $this->getComposerHomePath();
}
// Ensure that the PHP interpreter is in the PATH as well.
$env['PATH'] = $this->getEnv('PATH') . ":$php_dir";
// Ensure that the current PHP installation is the first place that will be
// searched when looking for the PHP interpreter.
$env['PATH'] = static::getPhpDirectory() . ':' . $this->getEnv('PATH');
return $process->setEnv($env);
}
Loading