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

Breadcrumb

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

function Config::__construct

Same name in this branch
  1. 11.1.x vendor/squizlabs/php_codesniffer/src/Config.php \PHP_CodeSniffer\Config::__construct()
  2. 11.1.x composer/Plugin/VendorHardening/Config.php \Drupal\Composer\Plugin\VendorHardening\Config::__construct()
  3. 11.1.x core/lib/Drupal/Core/Config/Config.php \Drupal\Core\Config\Config::__construct()
  4. 11.1.x core/modules/migrate/src/Plugin/migrate/destination/Config.php \Drupal\migrate\Plugin\migrate\destination\Config::__construct()

Parameters

bool $useEnvironment Use COMPOSER_ environment variables to replace config settings:

?string $baseDir Optional base directory of the config:

File

vendor/composer/composer/src/Composer/Config.php, line 124

Class

Config
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer

Code

public function __construct(bool $useEnvironment = true, ?string $baseDir = null) {
    // load defaults
    $this->config = static::$defaultConfig;
    $this->repositories = static::$defaultRepositories;
    $this->useEnvironment = $useEnvironment;
    $this->baseDir = is_string($baseDir) && '' !== $baseDir ? $baseDir : null;
    foreach ($this->config as $configKey => $configValue) {
        $this->setSourceOfConfigValue($configValue, $configKey, self::SOURCE_DEFAULT);
    }
    foreach ($this->repositories as $configKey => $configValue) {
        $this->setSourceOfConfigValue($configValue, 'repositories.' . $configKey, self::SOURCE_DEFAULT);
    }
}
RSS feed
Powered by Drupal