Composer API
Class

Composer\Package\Archiver\ArchiveManager

class ArchiveManager

Methods

__construct(DownloadManager $downloadManager)

addArchiver(ArchiverInterface $archiver)

$this setOverwriteFiles(bool $overwriteFiles)

Set whether existing archives should be overwritten

string getPackageFilename(PackageInterface $package)

Generate a distinct filename for a particular version of a package.

string archive(PackageInterface $package, string $format, string $targetDir, string|null $fileName = null, bool $ignoreFilters = false)

Create an archive of the specified package.

Details

at line 39
public __construct(DownloadManager $downloadManager)

Parameters

DownloadManager $downloadManager A manager used to download package sources

at line 47
public addArchiver(ArchiverInterface $archiver)

Parameters

ArchiverInterface $archiver

at line 59
public $this setOverwriteFiles(bool $overwriteFiles)

Set whether existing archives should be overwritten

Parameters

bool $overwriteFiles New setting

Return Value

$this

at line 73
public string getPackageFilename(PackageInterface $package)

Generate a distinct filename for a particular version of a package.

Parameters

PackageInterface $package The package to get a name for

Return Value

string A filename without an extension

at line 107
public string archive(PackageInterface $package, string $format, string $targetDir, string|null $fileName = null, bool $ignoreFilters = false)

Create an archive of the specified package.

Parameters

PackageInterface $package The package to archive
string $format The format of the archive (zip, tar, ...)
string $targetDir The directory where to build the archive
string|null $fileName The relative file name to use for the archive, or null to generate the package name. Note that the format will be appended to this name
bool $ignoreFilters Ignore filters when looking for files in the package

Return Value

string The path of the created archive

Exceptions

InvalidArgumentException
RuntimeException