class Config (View source)

Constants

RELATIVE_PATHS

Properties

static $defaultConfig
static $defaultRepositories

Methods

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

No description

setConfigSource(ConfigSourceInterface $source)

No description

getConfigSource()

No description

setAuthConfigSource(ConfigSourceInterface $source)

No description

getAuthConfigSource()

No description

merge(array $config)

Merges new config values with the existing ones (overriding)

array
getRepositories()

No description

mixed
get(string $key, int $flags = 0)

Returns a setting

all($flags = 0)

No description

raw()

No description

bool
has(string $key)

Checks whether a setting exists

prohibitUrlByConfig(string $url, IOInterface $io = null)

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

Details

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

Parameters

bool $useEnvironment Use COMPOSER_ environment variables to replace config settings
string $baseDir Optional base directory of the config

setConfigSource(ConfigSourceInterface $source)

Parameters

ConfigSourceInterface $source

getConfigSource()

setAuthConfigSource(ConfigSourceInterface $source)

Parameters

ConfigSourceInterface $source

getAuthConfigSource()

merge(array $config)

Merges new config values with the existing ones (overriding)

Parameters

array $config

array getRepositories()

Return Value

array

mixed get(string $key, int $flags = 0)

Returns a setting

Parameters

string $key
int $flags Options (see class constants)

Return Value

mixed

Exceptions

RuntimeException

all($flags = 0)

Parameters

$flags

raw()

bool has(string $key)

Checks whether a setting exists

Parameters

string $key

Return Value

bool

prohibitUrlByConfig(string $url, IOInterface $io = null)

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

Parameters

string $url
IOInterface $io