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\InstallerCode
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);
}
});
}