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

Breadcrumb

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

function VcsDownloader::install

@inheritDoc

Overrides DownloaderInterface::install

File

vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php, line 126

Class

VcsDownloader
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Downloader

Code

public function install(PackageInterface $package, string $path) : PromiseInterface {
    if (!$package->getSourceReference()) {
        throw new \InvalidArgumentException('Package ' . $package->getPrettyName() . ' is missing reference information');
    }
    $this->io
        ->writeError("  - " . InstallOperation::format($package) . ': ', false);
    $urls = $this->prepareUrls($package->getSourceUrls());
    while ($url = array_shift($urls)) {
        try {
            $this->doInstall($package, $path, $url);
            break;
        } catch (\Exception $e) {
            // rethrow phpunit exceptions to avoid hard to debug bug failures
            if ($e instanceof \PHPUnit\Framework\Exception) {
                throw $e;
            }
            if ($this->io
                ->isDebug()) {
                $this->io
                    ->writeError('Failed: [' . get_class($e) . '] ' . $e->getMessage());
            }
            elseif (count($urls)) {
                $this->io
                    ->writeError('    Failed, trying the next URL');
            }
            if (!count($urls)) {
                throw $e;
            }
        }
    }
    return \React\Promise\resolve(null);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal