Composer API
Class

Composer\Config\JsonConfigSource

class JsonConfigSource implements ConfigSourceInterface

JSON Configuration Source

Methods

__construct(JsonFile $file, bool $authConfig = false)

Constructor

string getName()

Gives a user-friendly name to this source (file path or so)

addRepository(string $name, array $config)

Add a repository

removeRepository(string $name)

Remove a repository

addConfigSetting(string $name, string $value)

Add a config setting

removeConfigSetting(string $name)

Remove a config setting

addProperty(string $name, string $value)

Add a property

removeProperty(string $name)

Remove a property

addLink(string $type, string $name, string $value)

Add a package link

removeLink(string $type, string $name)

Remove a package link

Details

at line 43
public __construct(JsonFile $file, bool $authConfig = false)

Constructor

Parameters

JsonFile $file
bool $authConfig

at line 52
public string getName()

Gives a user-friendly name to this source (file path or so)

Return Value

string

at line 60
public addRepository(string $name, array $config)

Add a repository

Parameters

string $name Name
array $config Configuration

at line 85
public removeRepository(string $name)

Remove a repository

Parameters

string $name

at line 95
public addConfigSetting(string $name, string $value)

Add a config setting

Parameters

string $name Name
string $value Value

at line 115
public removeConfigSetting(string $name)

Remove a config setting

Parameters

string $name

at line 135
public addProperty(string $name, string $value)

Add a property

Parameters

string $name Name
string $value Value

at line 158
public removeProperty(string $name)

Remove a property

Parameters

string $name

Add a package link

Parameters

string $type Type (require, require-dev, provide, suggest, replace, conflict)
string $name Name
string $value Value

Remove a package link

Parameters

string $type Type (require, require-dev, provide, suggest, replace, conflict)
string $name Name