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

Breadcrumb

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

function VcsDownloader::prepare

@inheritDoc

Overrides DownloaderInterface::prepare

File

vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php, line 96

Class

VcsDownloader
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Downloader

Code

public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null) : PromiseInterface {
    if ($type === 'update') {
        $this->cleanChanges($prevPackage, $path, true);
        $this->hasCleanedChanges[$prevPackage->getUniqueName()] = true;
    }
    elseif ($type === 'install') {
        $this->filesystem
            ->emptyDirectory($path);
    }
    elseif ($type === 'uninstall') {
        $this->cleanChanges($package, $path, false);
    }
    return \React\Promise\resolve(null);
}
RSS feed
Powered by Drupal