Constants

RELATIVE_PATHS

RELATIVE_PATHS = 1

Properties

$defaultConfig

$defaultConfig : 

Type

$defaultRepositories

$defaultRepositories : 

Type

$config

$config : 

Type

$baseDir

$baseDir : 

Type

$repositories

$repositories : 

Type

$useEnvironment

$useEnvironment : 

Type

$warnedHosts

$warnedHosts : 

Type

Methods

__construct()

__construct(boolean  $useEnvironment = true, string  $baseDir = null) 

Parameters

boolean $useEnvironment

Use COMPOSER_ environment variables to replace config settings

string $baseDir

Optional base directory of the config

getConfigSource()

getConfigSource() 

getAuthConfigSource()

getAuthConfigSource() 

merge()

merge(array  $config) 

Merges new config values with the existing ones (overriding)

Parameters

array $config

getRepositories()

getRepositories() : array

Returns

array

get()

get(string  $key, integer  $flags) : mixed

Returns a setting

Parameters

string $key
integer $flags

Options (see class constants)

Throws

\RuntimeException

Returns

mixed

all()

all(  $flags) 

Parameters

$flags

raw()

raw() 

has()

has(string  $key) : boolean

Checks whether a setting exists

Parameters

string $key

Returns

boolean

prohibitUrlByConfig()

prohibitUrlByConfig(string  $url, \Composer\IO\IOInterface  $io = null) 

Validates that the passed URL is allowed to be used by current config, or throws an exception.

Parameters

string $url
\Composer\IO\IOInterface $io

process()

process(string|integer|null  $value, integer  $flags) : string|integer|null

Replaces {$refs} inside a config string

Parameters

string|integer|null $value

a config string that can contain {$refs-to-other-config}

integer $flags

Options (see class constants)

Returns

string|integer|null

realpath()

realpath(string  $path) : string

Turns relative paths in absolute paths without realpath()

Since the dirs might not exist yet we can not call realpath or it will fail.

Parameters

string $path

Returns

string

getComposerEnv()

getComposerEnv(string  $var) : string|boolean

Reads the value of a Composer environment variable

This should be used to read COMPOSER_ environment variables that overload config values.

Parameters

string $var

Returns

string|boolean

disableRepoByName()

disableRepoByName(  $name) 

Parameters

$name