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

Breadcrumb

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

function BaseCommand::createComposerInstance

Calls {

Parameters

mixed $config either a configuration array or a filename to read from, if null it will read from: the default filename

Return value

Composer

See also

Factory::create()} with the given arguments, taking into account flags and default states for disabling scripts and plugins

4 calls to BaseCommand::createComposerInstance()
CreateProjectCommand::installProject in vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php
CreateProjectCommand::installRootPackage in vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php
SearchCommand::execute in vendor/composer/composer/src/Composer/Command/SearchCommand.php
Executes the current command.
ValidateCommand::execute in vendor/composer/composer/src/Composer/Command/ValidateCommand.php
Executes the current command.

File

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

Class

BaseCommand
Base class for Composer commands

Namespace

Composer\Command

Code

protected function createComposerInstance(InputInterface $input, IOInterface $io, $config = null, ?bool $disablePlugins = null, ?bool $disableScripts = null) : Composer {
    $disablePlugins = $disablePlugins === true || $input->hasParameterOption('--no-plugins');
    $disableScripts = $disableScripts === true || $input->hasParameterOption('--no-scripts');
    $application = parent::getApplication();
    if ($application instanceof Application && $application->getDisablePluginsByDefault()) {
        $disablePlugins = true;
    }
    if ($application instanceof Application && $application->getDisableScriptsByDefault()) {
        $disableScripts = true;
    }
    return Factory::create($io, $config, $disablePlugins, $disableScripts);
}

API Navigation

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