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

Breadcrumb

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

function ArchiveManager::getSupportedFormats

Return value

string[]

1 call to ArchiveManager::getSupportedFormats()
ArchiveManager::archive in vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php
Create an archive of the specified package.

File

vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php, line 264

Class

ArchiveManager
@author Matthieu Moquet <matthieu@moquet.net> @author Till Klampaeckel <till@php.net>

Namespace

Composer\Package\Archiver

Code

private function getSupportedFormats() : array {
    // The problem is that the \Composer\Package\Archiver\ArchiverInterface
    // doesn't provide method to get the supported formats.
    // Supported formats are also hard-coded into the description of the
    // --format option.
    // See \Composer\Command\ArchiveCommand::configure().
    $formats = [];
    foreach ($this->archivers as $archiver) {
        $items = [];
        switch (get_class($archiver)) {
            case ZipArchiver::class:
                $items = [
                    'zip',
                ];
                break;
            case PharArchiver::class:
                $items = [
                    'zip',
                    'tar',
                    'tar.gz',
                    'tar.bz2',
                ];
                break;
        }
        $formats = array_merge($formats, $items);
    }
    return array_unique($formats);
}

API Navigation

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