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

Breadcrumb

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

function LibraryInstaller::update

@inheritDoc

Overrides InstallerInterface::update

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

File

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

Class

LibraryInstaller
Package installation manager.

Namespace

Composer\Installer

Code

public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) {
    if (!$repo->hasPackage($initial)) {
        throw new \InvalidArgumentException('Package is not installed: ' . $initial);
    }
    $this->initializeVendorDir();
    $this->binaryInstaller
        ->removeBinaries($initial);
    $promise = $this->updateCode($initial, $target);
    if (!$promise instanceof PromiseInterface) {
        $promise = \React\Promise\resolve(null);
    }
    $binaryInstaller = $this->binaryInstaller;
    $installPath = $this->getInstallPath($target);
    return $promise->then(static function () use ($binaryInstaller, $installPath, $target, $initial, $repo) : void {
        $binaryInstaller->installBinaries($target, $installPath);
        $repo->removePackage($initial);
        if (!$repo->hasPackage($target)) {
            $repo->addPackage(clone $target);
        }
    });
}

API Navigation

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