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

Breadcrumb

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

function Factory::create

Same name in this branch
  1. 11.1.x vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/Factory.php \phpDocumentor\Reflection\DocBlock\Tags\Factory\Factory::create()

Parameters

IOInterface $io IO instance:

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

bool|'local'|'global' $disablePlugins Whether plugins should not be loaded, can be set to local or global to only disable local/global plugins:

bool $disableScripts Whether scripts should not be run:

3 calls to Factory::create()
Application::getComposer in vendor/composer/composer/src/Composer/Console/Application.php
BaseCommand::createComposerInstance in vendor/composer/composer/src/Composer/Command/BaseCommand.php
Calls {
Plugin::postUpdate in vendor/php-http/discovery/src/Composer/Plugin.php

File

vendor/composer/composer/src/Composer/Factory.php, line 617

Class

Factory
Creates a configured instance of composer.

Namespace

Composer

Code

public static function create(IOInterface $io, $config = null, $disablePlugins = false, bool $disableScripts = false) : Composer {
    $factory = new static();
    // for BC reasons, if a config is passed in either as array or a path that is not the default composer.json path
    // we disable local plugins as they really should not be loaded from CWD
    // If you want to avoid this behavior, you should be calling createComposer directly with a $cwd arg set correctly
    // to the path where the composer.json being loaded resides
    if ($config !== null && $config !== self::getComposerFile() && $disablePlugins === false) {
        $disablePlugins = 'local';
    }
    return $factory->createComposer($io, $config, $disablePlugins, null, true, $disableScripts);
}

API Navigation

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