Repository
Winter config repository class.
class Winter\Storm\Config\Repository
extends Illuminate\Config\Repository
implements
ArrayAccess,
Illuminate\Contracts\Config\Repository
Extends
Class | Description |
---|---|
Illuminate\Config\Repository
|
Traits
Trait | Description |
---|---|
KeyParser
|
Key Parser trait |
Properties
protected
$afterLoad
:
array
= []
The after load callbacks for namespaces.
protected
$aliases
:
array
= []
All of the namespace aliases.
protected $environment : string
The current environment.
protected
$items
:
array
= []
All of the configuration items.
protected $loader : Winter\Storm\Config\LoaderInterface
The loader implementation.
protected
$packages
:
array
= []
All of the registered packages.
inherited
protected
$keyParserCache
:
array
= []
A cache of the parsed items.
Methods
public __construct (Winter\Storm\Config\LoaderInterface $loader, string $environment) : void
Create a new configuration repository.
Property | Type | Description |
---|---|---|
$loader | Winter\Storm\Config\LoaderInterface |
Winter\Storm\Config\LoaderInterface
|
$environment | string |
string
|
public addNamespace (string $namespace, string $hint) : void
Add a new namespace to the loader.
Property | Type | Description |
---|---|---|
$namespace | string |
string
|
$hint | string |
string
|
public afterLoading (string $namespace, Closure $callback) : void
Register an after load callback for a given namespace.
Property | Type | Description |
---|---|---|
$namespace | string |
string
|
$callback | Closure |
Closure
|
public
get (string $key, mixed $default = null
)
: mixed
Get the specified configuration value.
Property | Type | Description |
---|---|---|
$key | string |
string
|
$default | mixed |
mixed
|
public getAfterLoadCallbacks () : array
Get the after load callback array.
public getEnvironment () : string
Get the current configuration environment.
public getItems () : array
Get all of the configuration items.
public getLoader () : Winter\Storm\Config\LoaderInterface
public getMany (array $keys) : array
Get many configuration values.
Property | Type | Description |
---|---|---|
$keys | array |
array
|
public getNamespaces () : array
Returns all registered namespaces with the config loader.
public has (string $key) : bool
Determine if the given configuration value exists.
Property | Type | Description |
---|---|---|
$key | string |
string
|
public hasGroup (string $key) : bool
Determine if a configuration group exists.
Property | Type | Description |
---|---|---|
$key | string |
string
|
public offsetExists (string $key) : bool
Determine if the given configuration option exists.
Property | Type | Description |
---|---|---|
$key | string |
string
|
public offsetGet (string $key) : mixed
Get a configuration option.
Property | Type | Description |
---|---|---|
$key | string |
string
|
public offsetSet (string $key, mixed $value) : void
Set a configuration option.
Property | Type | Description |
---|---|---|
$key | string |
string
|
$value | mixed |
mixed
|
public offsetUnset (string $key) : void
Unset a configuration option.
Property | Type | Description |
---|---|---|
$key | string |
string
|
public package (string $namespace, string $hint) : void
Register a package for cascading configuration.
Property | Type | Description |
---|---|---|
$namespace | string |
string
|
$hint | string |
string
|
public parseConfigKey (string $key) : array
Parse a key into namespace, group, and item.
Property | Type | Description |
---|---|---|
$key | string |
string
|
public registerNamespaceAlias (string $namespace, string $alias) : void
Add a alias to a namespace in the loader.
// to allow for config('alias.demo::foo') to redirect to config('winter.demo::foo') Config::registerNamespaceAlias('Winter.Demo', 'Alias.Demo');
Property | Type | Description |
---|---|---|
$namespace | string |
string
|
$alias | string |
string
|
public registerPackageFallback (string $namespace, string $alias) : void
Register an alias in the loader that will add fallback to alias support if a package config is not found
// to allow for config('winter.demo::foo') to fallback to global 'alias.demo' config Config::registerPackageFallback('Winter.Demo', 'Alias.Demo');
Property | Type | Description |
---|---|---|
$namespace | string |
string
|
$alias | string |
string
|
public
set (array | string $key, mixed $value = null
)
: void
Set a given configuration value.
Property | Type | Description |
---|---|---|
$key | array | string |
array | string
|
$value | mixed |
mixed
|
public setLoader (Winter\Storm\Config\LoaderInterface $loader) : void
Set the loader implementation.
Property | Type | Description |
---|---|---|
$loader | Winter\Storm\Config\LoaderInterface |
Winter\Storm\Config\LoaderInterface
|
protected callAfterLoad (string $namespace, string $group, array $items) : array
Call the after load callback for a namespace.
Property | Type | Description |
---|---|---|
$namespace | string |
string
|
$group | string |
string
|
$items | array |
array
|
protected
getCollection (string $group, string $namespace = null
)
: string
Get the collection identifier.
Property | Type | Description |
---|---|---|
$group | string |
string
|
$namespace | string |
string
|
protected load (string $group, string $namespace, string $collection) : void
Load the configuration group for the key.
Property | Type | Description |
---|---|---|
$group | string |
string
|
$namespace | string |
string
|
$collection | string |
string
|
protected parseNamespacedSegments (string $key) : array
Parse an array of namespaced segments.
Property | Type | Description |
---|---|---|
$key | string |
string
|
protected parsePackageSegments (string $key, string $namespace, string $item) : array
Parse the segments of a package namespace.
Property | Type | Description |
---|---|---|
$key | string |
string
|
$namespace | string |
string
|
$item | string |
string
|
inherited public parseKey (string $key) : array
Parse a key into namespace, group, and item.
Property | Type | Description |
---|---|---|
$key | string |
string
|
inherited public setParsedKey (string $key, array $parsed) : void
Set the parsed value of a key.
Property | Type | Description |
---|---|---|
$key | string |
string
|
$parsed | array |
array
|
inherited protected keyParserParseBasicSegments (array $segments) : array
Parse an array of basic segments.
Property | Type | Description |
---|---|---|
$segments | array |
array
|
inherited protected keyParserParseSegments (string $key) : array
Parse an array of namespaced segments.
Property | Type | Description |
---|---|---|
$key | string |
string
|