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

Breadcrumb

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

function LibraryInstaller::uninstall

@inheritDoc

Overrides InstallerInterface::uninstall

6 calls to LibraryInstaller::uninstall()
Installer::uninstall in vendor/composer/installers/src/Composer/Installers/Installer.php
@inheritDoc
Installer::uninstall in vendor/composer/installers/src/Composer/Installers/Installer.php
@inheritDoc
PluginInstaller::rollbackInstall in vendor/composer/composer/src/Composer/Installer/PluginInstaller.php
PluginInstaller::rollbackInstall in vendor/composer/composer/src/Composer/Installer/PluginInstaller.php
PluginInstaller::uninstall in vendor/composer/composer/src/Composer/Installer/PluginInstaller.php
@inheritDoc

... See full list

2 methods override LibraryInstaller::uninstall()
Installer::uninstall in vendor/composer/installers/src/Composer/Installers/Installer.php
@inheritDoc
PluginInstaller::uninstall in vendor/composer/composer/src/Composer/Installer/PluginInstaller.php
@inheritDoc

File

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

Class

LibraryInstaller
Package installation manager.

Namespace

Composer\Installer

Code

public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) {
    if (!$repo->hasPackage($package)) {
        throw new \InvalidArgumentException('Package is not installed: ' . $package);
    }
    $promise = $this->removeCode($package);
    if (!$promise instanceof PromiseInterface) {
        $promise = \React\Promise\resolve(null);
    }
    $binaryInstaller = $this->binaryInstaller;
    $downloadPath = $this->getPackageBasePath($package);
    $filesystem = $this->filesystem;
    return $promise->then(static function () use ($binaryInstaller, $filesystem, $downloadPath, $package, $repo) : void {
        $binaryInstaller->removeBinaries($package);
        $repo->removePackage($package);
        if (strpos($package->getName(), '/')) {
            $packageVendorDir = dirname($downloadPath);
            if (is_dir($packageVendorDir) && $filesystem->isDirEmpty($packageVendorDir)) {
                Silencer::call('rmdir', $packageVendorDir);
            }
        }
    });
}

API Navigation

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