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

Breadcrumb

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

function ArchiveCommand::configure

Overrides Command::configure

File

vendor/composer/composer/src/Composer/Command/ArchiveCommand.php, line 50

Class

ArchiveCommand
Creates an archive of a package for distribution.

Namespace

Composer\Command

Code

protected function configure() : void {
    $this->setName('archive')
        ->setDescription('Creates an archive of this composer package')
        ->setDefinition([
        new InputArgument('package', InputArgument::OPTIONAL, 'The package to archive instead of the current project', null, $this->suggestAvailablePackage()),
        new InputArgument('version', InputArgument::OPTIONAL, 'A version constraint to find the package to archive'),
        new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the resulting archive: tar, tar.gz, tar.bz2 or zip (default tar)', null, self::FORMATS),
        new InputOption('dir', null, InputOption::VALUE_REQUIRED, 'Write the archive to this directory'),
        new InputOption('file', null, InputOption::VALUE_REQUIRED, 'Write the archive with the given file name.' . ' Note that the format will be appended.'),
        new InputOption('ignore-filters', null, InputOption::VALUE_NONE, 'Ignore filters when saving package'),
    ])
        ->setHelp(<<<EOT
The <info>archive</info> command creates an archive of the specified format
containing the files and directories of the Composer project or the specified
package in the specified version and writes it to the specified directory.

<info>php composer.phar archive [--format=zip] [--dir=/foo] [--file=filename] [package [version]]</info>

Read more at https://getcomposer.org/doc/03-cli.md#archive
EOT
);
}
RSS feed
Powered by Drupal