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

Breadcrumb

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

function PluginInstaller::update

@inheritDoc

Overrides LibraryInstaller::update

File

vendor/composer/composer/src/Composer/Installer/PluginInstaller.php, line 100

Class

PluginInstaller
Installer for plugin packages

Namespace

Composer\Installer

Code

public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) {
    $promise = parent::update($repo, $initial, $target);
    if (!$promise instanceof PromiseInterface) {
        $promise = \React\Promise\resolve(null);
    }
    return $promise->then(function () use ($initial, $target, $repo) : void {
        try {
            Platform::workaroundFilesystemIssues();
            $this->getPluginManager()
                ->deactivatePackage($initial);
            $this->getPluginManager()
                ->registerPackage($target, true);
        } catch (\Exception $e) {
            $this->rollbackInstall($e, $repo, $target);
        }
    });
}

API Navigation

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