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\ArchiverCode
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);
}