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

Breadcrumb

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

function BaseCommand::tryComposer

Retrieves the default Composer\Composer instance or null

Use this instead of getComposer(false)

Parameters

bool|null $disablePlugins If null, reads --no-plugins as default:

bool|null $disableScripts If null, reads --no-scripts as default:

11 calls to BaseCommand::tryComposer()
ArchiveCommand::execute in vendor/composer/composer/src/Composer/Command/ArchiveCommand.php
Executes the current command.
ArchiveCommand::selectPackage in vendor/composer/composer/src/Composer/Command/ArchiveCommand.php
BaseCommand::getComposer in vendor/composer/composer/src/Composer/Command/BaseCommand.php
BaseCommand::initialize in vendor/composer/composer/src/Composer/Command/BaseCommand.php
@inheritDoc
ClearCacheCommand::execute in vendor/composer/composer/src/Composer/Command/ClearCacheCommand.php
Executes the current command.

... See full list

File

vendor/composer/composer/src/Composer/Command/BaseCommand.php, line 122

Class

BaseCommand
Base class for Composer commands

Namespace

Composer\Command

Code

public function tryComposer(?bool $disablePlugins = null, ?bool $disableScripts = null) : ?Composer {
    if (null === $this->composer) {
        $application = parent::getApplication();
        if ($application instanceof Application) {
            $this->composer = $application->getComposer(false, $disablePlugins, $disableScripts);
        }
    }
    return $this->composer;
}

API Navigation

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