Fix ProcessExecutor bootstrapping, fixes #10703
parent
0efb557afc
commit
849bc51ce7
|
@ -235,7 +235,7 @@ EOT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$process = new ProcessExecutor($io);
|
$process = $composer->getLoop()->getProcessExecutor();
|
||||||
$fs = new Filesystem($process);
|
$fs = new Filesystem($process);
|
||||||
|
|
||||||
// dispatch event
|
// dispatch event
|
||||||
|
|
|
@ -80,6 +80,9 @@ EOT
|
||||||
|
|
||||||
$io->write('Checking composer.json: ', false);
|
$io->write('Checking composer.json: ', false);
|
||||||
$this->outputResult($this->checkComposerSchema());
|
$this->outputResult($this->checkComposerSchema());
|
||||||
|
$this->process = $composer->getLoop()->getProcessExecutor() ?? new ProcessExecutor($io);
|
||||||
|
} else {
|
||||||
|
$this->process = new ProcessExecutor($io);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($composer) {
|
if ($composer) {
|
||||||
|
@ -92,7 +95,6 @@ EOT
|
||||||
$config->prohibitUrlByConfig('http://repo.packagist.org', new NullIO);
|
$config->prohibitUrlByConfig('http://repo.packagist.org', new NullIO);
|
||||||
|
|
||||||
$this->httpDownloader = Factory::createHttpDownloader($io, $config);
|
$this->httpDownloader = Factory::createHttpDownloader($io, $config);
|
||||||
$this->process = new ProcessExecutor($io);
|
|
||||||
|
|
||||||
$io->write('Checking platform settings: ', false);
|
$io->write('Checking platform settings: ', false);
|
||||||
$this->outputResult($this->checkPlatform());
|
$this->outputResult($this->checkPlatform());
|
||||||
|
|
|
@ -96,7 +96,7 @@ EOT
|
||||||
$vcsVersionChanges = array();
|
$vcsVersionChanges = array();
|
||||||
|
|
||||||
$parser = new VersionParser;
|
$parser = new VersionParser;
|
||||||
$guesser = new VersionGuesser($composer->getConfig(), new ProcessExecutor($io), $parser);
|
$guesser = new VersionGuesser($composer->getConfig(), $composer->getLoop()->getProcessExecutor() ?? new ProcessExecutor($io), $parser);
|
||||||
$dumper = new ArrayDumper;
|
$dumper = new ArrayDumper;
|
||||||
|
|
||||||
// list packages
|
// list packages
|
||||||
|
|
|
@ -89,7 +89,7 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
|
||||||
$this->eventDispatcher = $eventDispatcher;
|
$this->eventDispatcher = $eventDispatcher;
|
||||||
$this->httpDownloader = $httpDownloader;
|
$this->httpDownloader = $httpDownloader;
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
$this->process = $process ?: new ProcessExecutor($io);
|
$this->process = $process ?? new ProcessExecutor($io);
|
||||||
$this->filesystem = $filesystem ?: new Filesystem($this->process);
|
$this->filesystem = $filesystem ?: new Filesystem($this->process);
|
||||||
|
|
||||||
if ($this->cache && $this->cache->gcIsNecessary()) {
|
if ($this->cache && $this->cache->gcIsNecessary()) {
|
||||||
|
|
|
@ -45,8 +45,8 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa
|
||||||
{
|
{
|
||||||
$this->io = $io;
|
$this->io = $io;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->process = $process ?: new ProcessExecutor($io);
|
$this->process = $process ?? new ProcessExecutor($io);
|
||||||
$this->filesystem = $fs ?: new Filesystem($this->process);
|
$this->filesystem = $fs ?? new Filesystem($this->process);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -71,7 +71,7 @@ class EventDispatcher
|
||||||
{
|
{
|
||||||
$this->composer = $composer;
|
$this->composer = $composer;
|
||||||
$this->io = $io;
|
$this->io = $io;
|
||||||
$this->process = $process ?: new ProcessExecutor($io);
|
$this->process = $process ?? new ProcessExecutor($io);
|
||||||
$this->eventStack = array();
|
$this->eventStack = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Locker
|
||||||
$this->contentHash = self::getContentHash($composerFileContents);
|
$this->contentHash = self::getContentHash($composerFileContents);
|
||||||
$this->loader = new ArrayLoader(null, true);
|
$this->loader = new ArrayLoader(null, true);
|
||||||
$this->dumper = new ArrayDumper();
|
$this->dumper = new ArrayDumper();
|
||||||
$this->process = $process ?: new ProcessExecutor($io);
|
$this->process = $process ?? new ProcessExecutor($io);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -54,7 +54,7 @@ class HhvmDetector
|
||||||
$this->executableFinder = $this->executableFinder ?: new ExecutableFinder();
|
$this->executableFinder = $this->executableFinder ?: new ExecutableFinder();
|
||||||
$hhvmPath = $this->executableFinder->find('hhvm');
|
$hhvmPath = $this->executableFinder->find('hhvm');
|
||||||
if ($hhvmPath !== null) {
|
if ($hhvmPath !== null) {
|
||||||
$this->processExecutor = $this->processExecutor ?: new ProcessExecutor();
|
$this->processExecutor = $this->processExecutor ?? new ProcessExecutor();
|
||||||
$exitCode = $this->processExecutor->execute(
|
$exitCode = $this->processExecutor->execute(
|
||||||
ProcessExecutor::escape($hhvmPath).
|
ProcessExecutor::escape($hhvmPath).
|
||||||
' --php -d hhvm.jit=0 -r "echo HHVM_VERSION;" 2>/dev/null',
|
' --php -d hhvm.jit=0 -r "echo HHVM_VERSION;" 2>/dev/null',
|
||||||
|
|
|
@ -51,7 +51,7 @@ class RepositoryManager
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->httpDownloader = $httpDownloader;
|
$this->httpDownloader = $httpDownloader;
|
||||||
$this->eventDispatcher = $eventDispatcher;
|
$this->eventDispatcher = $eventDispatcher;
|
||||||
$this->process = $process ?: new ProcessExecutor($io);
|
$this->process = $process ?? new ProcessExecutor($io);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -99,7 +99,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
||||||
$this->repoConfig = $repoConfig;
|
$this->repoConfig = $repoConfig;
|
||||||
$this->versionCache = $versionCache;
|
$this->versionCache = $versionCache;
|
||||||
$this->httpDownloader = $httpDownloader;
|
$this->httpDownloader = $httpDownloader;
|
||||||
$this->processExecutor = $process ?: new ProcessExecutor($io);
|
$this->processExecutor = $process ?? new ProcessExecutor($io);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRepoName()
|
public function getRepoName()
|
||||||
|
|
Loading…
Reference in New Issue