Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PathRepository.php

function PathRepository::__construct

Initializes path repository.

Parameters

array{url?: string, options?: array{symlink?: bool, reference?: string, relative?: bool, versions?: array<string, string>}} $repoConfig:

Overrides ArrayRepository::__construct

File

vendor/composer/composer/src/Composer/Repository/PathRepository.php, line 110

Class

PathRepository
This repository allows installing local packages that are not necessarily under their own VCS.

Namespace

Composer\Repository

Code

public function __construct(array $repoConfig, IOInterface $io, Config $config, ?HttpDownloader $httpDownloader = null, ?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 = $process ?? new ProcessExecutor($io);
    $this->versionGuesser = new VersionGuesser($config, $this->process, new VersionParser(), $io);
    $this->repoConfig = $repoConfig;
    $this->options = $repoConfig['options'] ?? [];
    if (!isset($this->options['relative'])) {
        $filesystem = new Filesystem();
        $this->options['relative'] = !$filesystem->isAbsolutePath($this->url);
    }
    parent::__construct();
}
RSS feed
Powered by Drupal