AbstractConfigurationProvider
in package
A configuration provider is a function that returns a promise that is fulfilled with a configuration object. This class provides base functionality usable by specific configuration provider implementations
Table of Contents
- ENV_CONFIG_FILE = 'AWS_CONFIG_FILE'
- ENV_PROFILE = 'AWS_PROFILE'
- $cacheKey : mixed
- $exceptionClass : mixed
- $interfaceClass : mixed
- cache() : callable
- Wraps a config provider and saves provided configuration in an instance of Aws\CacheInterface. Forwards calls when no config found in cache and updates cache with the results.
- chain() : callable
- Creates an aggregate configuration provider that invokes the provided variadic providers one after the other until a provider returns configuration.
- memoize() : callable
- Wraps a config provider and caches previously provided configuration.
- getDefaultConfigFilename() : string
- Gets default config file location from environment, falling back to aws default location
- getHomeDir() : null|string
- Gets the environment's HOME directory if available.
- reject() : RejectedPromise
- Reject promise with standardized exception.
Constants
ENV_CONFIG_FILE
public
mixed
ENV_CONFIG_FILE
= 'AWS_CONFIG_FILE'
ENV_PROFILE
public
mixed
ENV_PROFILE
= 'AWS_PROFILE'
Properties
$cacheKey
public
static mixed
$cacheKey
$exceptionClass
protected
static mixed
$exceptionClass
$interfaceClass
protected
static mixed
$interfaceClass
Methods
cache()
Wraps a config provider and saves provided configuration in an instance of Aws\CacheInterface. Forwards calls when no config found in cache and updates cache with the results.
public
static cache(callable $provider, CacheInterface $cache[, string|null $cacheKey = null ]) : callable
Parameters
- $provider : callable
-
Configuration provider function to wrap
- $cache : CacheInterface
-
Cache to store configuration
- $cacheKey : string|null = null
-
(optional) Cache key to use
Return values
callable —chain()
Creates an aggregate configuration provider that invokes the provided variadic providers one after the other until a provider returns configuration.
public
static chain() : callable
Return values
callable —memoize()
Wraps a config provider and caches previously provided configuration.
public
static memoize(callable $provider) : callable
Parameters
- $provider : callable
-
Config provider function to wrap.
Return values
callable —getDefaultConfigFilename()
Gets default config file location from environment, falling back to aws default location
protected
static getDefaultConfigFilename() : string
Return values
string —getHomeDir()
Gets the environment's HOME directory if available.
protected
static getHomeDir() : null|string
Return values
null|string —reject()
Reject promise with standardized exception.
protected
static reject( $msg) : RejectedPromise