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

Breadcrumb

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

function Installer::uninstall

Overrides LibraryInstaller::uninstall

File

vendor/composer/installers/src/Composer/Installers/Installer.php, line 164

Class

Installer

Namespace

Composer\Installers

Code

public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) {
    $installPath = $this->getPackageBasePath($package);
    $io = $this->io;
    $outputStatus = function () use ($io, $installPath) {
        $io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
    };
    $promise = parent::uninstall($repo, $package);
    // Composer v2 might return a promise here
    if ($promise instanceof PromiseInterface) {
        return $promise->then($outputStatus);
    }
    // If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
    $outputStatus();
    return null;
}

API Navigation

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