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

Breadcrumb

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

function ArchiveCommand::execute

Overrides Command::execute

File

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

Class

ArchiveCommand
Creates an archive of a package for distribution.

Namespace

Composer\Command

Code

protected function execute(InputInterface $input, OutputInterface $output) : int {
    $composer = $this->tryComposer();
    $config = null;
    if ($composer) {
        $config = $composer->getConfig();
        $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'archive', $input, $output);
        $eventDispatcher = $composer->getEventDispatcher();
        $eventDispatcher->dispatch($commandEvent->getName(), $commandEvent);
        $eventDispatcher->dispatchScript(ScriptEvents::PRE_ARCHIVE_CMD);
    }
    if (!$config) {
        $config = Factory::createConfig();
    }
    $format = $input->getOption('format') ?? $config->get('archive-format');
    $dir = $input->getOption('dir') ?? $config->get('archive-dir');
    $returnCode = $this->archive($this->getIO(), $config, $input->getArgument('package'), $input->getArgument('version'), $format, $dir, $input->getOption('file'), $input->getOption('ignore-filters'), $composer);
    if (0 === $returnCode && $composer) {
        $composer->getEventDispatcher()
            ->dispatchScript(ScriptEvents::POST_ARCHIVE_CMD);
    }
    return $returnCode;
}

API Navigation

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