Skip to content

Commit

Permalink
Make sure path repo reuses an existing ProcessExecutor if provided to…
Browse files Browse the repository at this point in the history
… it, fixes #10642
  • Loading branch information
Seldaek committed Mar 21, 2022
1 parent bd89a67 commit 8b373a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Composer/Repository/PathRepository.php
Expand Up @@ -13,6 +13,7 @@
namespace Composer\Repository;

use Composer\Config;
use Composer\EventDispatcher\EventDispatcher;
use Composer\IO\IOInterface;
use Composer\Json\JsonFile;
use Composer\Package\CompleteAliasPackage;
Expand All @@ -21,6 +22,7 @@
use Composer\Package\Version\VersionGuesser;
use Composer\Package\Version\VersionParser;
use Composer\Pcre\Preg;
use Composer\Util\HttpDownloader;
use Composer\Util\Platform;
use Composer\Util\ProcessExecutor;
use Composer\Util\Filesystem;
Expand Down Expand Up @@ -109,15 +111,15 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn
* @param IOInterface $io
* @param Config $config
*/
public function __construct(array $repoConfig, IOInterface $io, Config $config)
public function __construct(array $repoConfig, IOInterface $io, Config $config, HttpDownloader $httpDownloader, EventDispatcher $dispatcher = null, ProcessExecutor $process = null)
{
if (!isset($repoConfig['url'])) {
throw new \RuntimeException('You must specify the `url` configuration for the path repository');
}

$this->loader = new ArrayLoader(null, true);
$this->url = Platform::expandPath($repoConfig['url']);
$this->process = new ProcessExecutor($io);
$this->process = $process ?? new ProcessExecutor($io);
$this->versionGuesser = new VersionGuesser($config, $this->process, new VersionParser());
$this->repoConfig = $repoConfig;
$this->options = $repoConfig['options'] ?? array();
Expand Down

0 comments on commit 8b373a1

Please sign in to comment.