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

Breadcrumb

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

function LibraryInstaller::install

@inheritDoc

Overrides InstallerInterface::install

2 calls to LibraryInstaller::install()
PluginInstaller::install in vendor/composer/composer/src/Composer/Installer/PluginInstaller.php
@inheritDoc
PluginInstaller::install in vendor/composer/composer/src/Composer/Installer/PluginInstaller.php
@inheritDoc
1 method overrides LibraryInstaller::install()
PluginInstaller::install in vendor/composer/composer/src/Composer/Installer/PluginInstaller.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php, line 142

Class

LibraryInstaller
Package installation manager.

Namespace

Composer\Installer

Code

public function install(InstalledRepositoryInterface $repo, PackageInterface $package) {
    $this->initializeVendorDir();
    $downloadPath = $this->getInstallPath($package);
    // remove the binaries if it appears the package files are missing
    if (!Filesystem::isReadable($downloadPath) && $repo->hasPackage($package)) {
        $this->binaryInstaller
            ->removeBinaries($package);
    }
    $promise = $this->installCode($package);
    if (!$promise instanceof PromiseInterface) {
        $promise = \React\Promise\resolve(null);
    }
    $binaryInstaller = $this->binaryInstaller;
    $installPath = $this->getInstallPath($package);
    return $promise->then(static function () use ($binaryInstaller, $installPath, $package, $repo) : void {
        $binaryInstaller->installBinaries($package, $installPath);
        if (!$repo->hasPackage($package)) {
            $repo->addPackage(clone $package);
        }
    });
}

API Navigation

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