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

Breadcrumb

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

function FileDownloader::getFileName

Gets file name for specific package

Parameters

PackageInterface $package package instance:

string $path download path:

Return value

string file name

4 calls to FileDownloader::getFileName()
ArchiveDownloader::install in vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php
@inheritDoc
FileDownloader::cleanup in vendor/composer/composer/src/Composer/Downloader/FileDownloader.php
@inheritDoc
FileDownloader::download in vendor/composer/composer/src/Composer/Downloader/FileDownloader.php
@inheritDoc
FileDownloader::install in vendor/composer/composer/src/Composer/Downloader/FileDownloader.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Downloader/FileDownloader.php, line 444

Class

FileDownloader
Base downloader for files

Namespace

Composer\Downloader

Code

protected function getFileName(PackageInterface $package, string $path) : string {
    $extension = $this->getDistPath($package, PATHINFO_EXTENSION);
    if ($extension === '') {
        $extension = $package->getDistType();
    }
    return rtrim($this->config
        ->get('vendor-dir') . '/composer/tmp-' . hash('md5', $package . spl_object_hash($package)) . '.' . $extension, '.');
}

API Navigation

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