PHP Class Platformsh\Cli\CliConfig

Show file Open project: commerceguys/platform-cli Class Usage Examples

Protected Properties

Property Type Description
$config
$env
$userConfig

Public Methods

Method Description
__construct ( array $env = null, string | null $defaultsFile = null, boolean $reset = false )
get ( string $name ) : mixed
getUserConfig ( ) : array
getUserConfigDir ( ) : string
has ( string $name, boolean $notNull = true ) : boolean
writeUserConfig ( array $config ) Update user configuration.

Protected Methods

Method Description
applyEnvironmentOverrides ( )
applyUserConfigOverrides ( )
getEnv ( string $name ) : mixed | false Get an environment variable
loadConfigFromFile ( string $filename ) : array

Method Details

__construct() public method

public __construct ( array $env = null, string | null $defaultsFile = null, boolean $reset = false )
$env array
$defaultsFile string | null
$reset boolean

applyEnvironmentOverrides() protected method

applyUserConfigOverrides() protected method

protected applyUserConfigOverrides ( )

get() public method

public get ( string $name ) : mixed
$name string
return mixed

getEnv() protected method

Get an environment variable
protected getEnv ( string $name ) : mixed | false
$name string The variable name. The configured prefix will be prepended.
return mixed | false The value of the environment variable, or false if it is not set.

getUserConfig() public method

public getUserConfig ( ) : array
return array

getUserConfigDir() public method

public getUserConfigDir ( ) : string
return string

has() public method

public has ( string $name, boolean $notNull = true ) : boolean
$name string
$notNull boolean
return boolean

loadConfigFromFile() protected method

protected loadConfigFromFile ( string $filename ) : array
$filename string
return array

writeUserConfig() public method

Update user configuration.
public writeUserConfig ( array $config )
$config array

Property Details

$config protected static property

protected static $config

$env protected property

protected $env

$userConfig protected property

protected $userConfig