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

Breadcrumb

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

function Factory::createGlobalComposer

@phpstan-return ($fullLoad is true ? Composer|null : PartialComposer|null)

Parameters

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

Return value

PartialComposer|Composer|null By default PartialComposer, but Composer if $fullLoad is set to true

1 call to Factory::createGlobalComposer()
Factory::createComposer in vendor/composer/composer/src/Composer/Factory.php
Creates a Composer instance

File

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

Class

Factory
Creates a configured instance of composer.

Namespace

Composer

Code

protected function createGlobalComposer(IOInterface $io, Config $config, $disablePlugins, bool $disableScripts, bool $fullLoad = false) : ?PartialComposer {
    // make sure if disable plugins was 'local' it is now turned off
    $disablePlugins = $disablePlugins === 'global' || $disablePlugins === true;
    $composer = null;
    try {
        $composer = $this->createComposer($io, $config->get('home') . '/composer.json', $disablePlugins, $config->get('home'), $fullLoad, $disableScripts);
    } catch (\Exception $e) {
        $io->writeError('Failed to initialize global composer: ' . $e->getMessage(), true, IOInterface::DEBUG);
    }
    return $composer;
}

API Navigation

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