Repository

Winter config repository class.

 class Winter\Storm\Config\Repository
extends Illuminate\Config\Repository
implements 
    ArrayAccess,
    Illuminate\Contracts\Config\Repository

Extends

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

Inherited from KeyParser

A cache of the parsed items.

Methods

public __construct (Winter\Storm\Config\LoaderInterface $loader, string $environment) : void

Create a new configuration repository.

Parameters
Property Description
$loader
Winter\Storm\Config\LoaderInterface
$environment
string
Returns
void

public addNamespace (string $namespace, string $hint) : void

Add a new namespace to the loader.

Parameters
Property Description
$namespace
string
$hint
string
Returns
void

public afterLoading (string $namespace, Closure $callback) : void

Register an after load callback for a given namespace.

Parameters
Property Description
$namespace
string
$callback
Closure
Returns
void

public get (string $key, mixed $default = null) : mixed

Get the specified configuration value.

Parameters
Property Description
$key
string
$default
mixed
Returns
mixed

public getAfterLoadCallbacks () : array

Get the after load callback array.

Returns
array

public getEnvironment () : string

Get the current configuration environment.

Returns
string

public getItems () : array

Get all of the configuration items.

Returns
array

public getLoader () : Winter\Storm\Config\LoaderInterface

Get the loader implementation.

Returns

public getMany (array $keys) : array

Get many configuration values.

Parameters
Property Description
$keys
array
Returns
array

public getNamespaces () : array

Returns all registered namespaces with the config loader.

Returns
array

public has (string $key) : bool

Determine if the given configuration value exists.

Parameters
Property Description
$key
string
Returns
bool

public hasGroup (string $key) : bool

Determine if a configuration group exists.

Parameters
Property Description
$key
string
Returns
bool

public offsetExists (string $key) : bool

Determine if the given configuration option exists.

Parameters
Property Description
$key
string
Returns
bool

public offsetGet (string $key) : mixed

Get a configuration option.

Parameters
Property Description
$key
string
Returns
mixed

public offsetSet (string $key, mixed $value) : void

Set a configuration option.

Parameters
Property Description
$key
string
$value
mixed
Returns
void

public offsetUnset (string $key) : void

Unset a configuration option.

Parameters
Property Description
$key
string
Returns
void

public package (string $namespace, string $hint) : void

Register a package for cascading configuration.

Parameters
Property Description
$namespace
string
$hint
string
Returns
void

public parseConfigKey (string $key) : array

Parse a key into namespace, group, and item.

Parameters
Property Description
$key
string
Returns
array

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');

Parameters
Property Description
$namespace
string
$alias
string
Returns
void

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');

Parameters
Property Description
$namespace
string
$alias
string
Returns
void

public set (array | string $key, mixed $value = null) : void

Set a given configuration value.

Parameters
Property Description
$key
array | string
$value
mixed
Returns
void

public setLoader (Winter\Storm\Config\LoaderInterface $loader) : void

Set the loader implementation.

Parameters
Property Description
$loader
Winter\Storm\Config\LoaderInterface
Returns
void

protected callAfterLoad (string $namespace, string $group, array $items) : array

Call the after load callback for a namespace.

Parameters
Property Description
$namespace
string
$group
string
$items
array
Returns
array

protected getCollection (string $group, string $namespace = null) : string

Get the collection identifier.

Parameters
Property Description
$group
string
$namespace
string
Returns
string

protected load (string $group, string $namespace, string $collection) : void

Load the configuration group for the key.

Parameters
Property Description
$group
string
$namespace
string
$collection
string
Returns
void

protected parseNamespacedSegments (string $key) : array

Parse an array of namespaced segments.

Parameters
Property Description
$key
string
Returns
array

protected parsePackageSegments (string $key, string $namespace, string $item) : array

Parse the segments of a package namespace.

Parameters
Property Description
$key
string
$namespace
string
$item
string
Returns
array

inherited public parseKey (string $key) : array

Inherited from KeyParser

Parse a key into namespace, group, and item.

Parameters
Property Description
$key
string
Returns
array

inherited public setParsedKey (string $key, array $parsed) : void

Inherited from KeyParser

Set the parsed value of a key.

Parameters
Property Description
$key
string
$parsed
array
Returns
void

inherited protected keyParserParseBasicSegments (array $segments) : array

Inherited from KeyParser

Parse an array of basic segments.

Parameters
Property Description
$segments
array
Returns
array

inherited protected keyParserParseSegments (string $key) : array

Inherited from KeyParser

Parse an array of namespaced segments.

Parameters
Property Description
$key
string
Returns
array
Copyright © 2024 Winter CMS