Documentation

Repository
in package
implements ArrayAccess, Repository Uses KeyParser

October config repository class.

Tags
author

Alexey Bobkov, Samuel Georges

Interfaces, Classes and Traits

ArrayAccess
Repository

Table of Contents

$afterLoad  : array<string|int, mixed>
The after load callbacks for namespaces.
$environment  : string
The current environment.
$items  : array<string|int, mixed>
All of the configuration items.
$keyParserCache  : array<string|int, mixed>
A cache of the parsed items.
$loader  : LoaderInterface
The loader implementation.
$packages  : array<string|int, mixed>
All of the registered packages.
__construct()  : void
Create a new configuration repository.
addNamespace()  : void
Add a new namespace to the loader.
afterLoading()  : void
Register an after load callback for a given namespace.
all()  : array<string|int, mixed>
Get all of the configuration items for the application.
get()  : mixed
Get the specified configuration value.
getAfterLoadCallbacks()  : array<string|int, mixed>
Get the after load callback array.
getEnvironment()  : string
Get the current configuration environment.
getItems()  : array<string|int, mixed>
Get all of the configuration items.
getLoader()  : LoaderInterface
Get the loader implementation.
getNamespaces()  : array<string|int, mixed>
Returns all registered namespaces with the config loader.
has()  : bool
Determine if the given configuration value exists.
hasGroup()  : bool
Determine if a configuration group exists.
offsetExists()  : bool
Determine if the given configuration option exists.
offsetGet()  : mixed
Get a configuration option.
offsetSet()  : void
Set a configuration option.
offsetUnset()  : void
Unset a configuration option.
package()  : void
Register a package for cascading configuration.
parseConfigKey()  : array<string|int, mixed>
Parse a key into namespace, group, and item.
parseKey()  : array<string|int, mixed>
Parse a key into namespace, group, and item.
prepend()  : void
Prepend a value onto an array configuration value.
push()  : void
Push a value onto an array configuration value.
set()  : void
Set a given configuration value.
setLoader()  : void
Set the loader implementation.
setParsedKey()  : void
Set the parsed value of a key.
callAfterLoad()  : array<string|int, mixed>
Call the after load callback for a namespace.
getCollection()  : string
Get the collection identifier.
keyParserParseBasicSegments()  : array<string|int, mixed>
Parse an array of basic segments.
keyParserParseSegments()  : array<string|int, mixed>
Parse an array of namespaced segments.
load()  : void
Load the configuration group for the key.
parseNamespacedSegments()  : array<string|int, mixed>
Parse an array of namespaced segments.
parsePackageSegments()  : array<string|int, mixed>
Parse the segments of a package namespace.

Properties

$afterLoad

The after load callbacks for namespaces.

protected array<string|int, mixed> $afterLoad = []

$environment

The current environment.

protected string $environment

$items

All of the configuration items.

protected array<string|int, mixed> $items = []

$keyParserCache

A cache of the parsed items.

protected array<string|int, mixed> $keyParserCache = []

$packages

All of the registered packages.

protected array<string|int, mixed> $packages = []

Methods

__construct()

Create a new configuration repository.

public __construct(LoaderInterface $loader, string $environment) : void
Parameters
$loader : LoaderInterface
$environment : string
Return values
void

addNamespace()

Add a new namespace to the loader.

public addNamespace(string $namespace, string $hint) : void
Parameters
$namespace : string
$hint : string
Return values
void

afterLoading()

Register an after load callback for a given namespace.

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

all()

Get all of the configuration items for the application.

public all() : array<string|int, mixed>
Return values
array<string|int, mixed>

get()

Get the specified configuration value.

public get(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null
Return values
mixed

getAfterLoadCallbacks()

Get the after load callback array.

public getAfterLoadCallbacks() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEnvironment()

Get the current configuration environment.

public getEnvironment() : string
Return values
string

getItems()

Get all of the configuration items.

public getItems() : array<string|int, mixed>
Return values
array<string|int, mixed>

getNamespaces()

Returns all registered namespaces with the config loader.

public getNamespaces() : array<string|int, mixed>
Return values
array<string|int, mixed>

has()

Determine if the given configuration value exists.

public has(string $key) : bool
Parameters
$key : string
Return values
bool

hasGroup()

Determine if a configuration group exists.

public hasGroup(string $key) : bool
Parameters
$key : string
Return values
bool

offsetExists()

Determine if the given configuration option exists.

public offsetExists(string $key) : bool
Parameters
$key : string
Return values
bool

offsetGet()

Get a configuration option.

public offsetGet(string $key) : mixed
Parameters
$key : string
Return values
mixed

offsetSet()

Set a configuration option.

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

offsetUnset()

Unset a configuration option.

public offsetUnset(string $key) : void
Parameters
$key : string
Return values
void

package()

Register a package for cascading configuration.

public package(string $namespace, string $hint) : void
Parameters
$namespace : string
$hint : string
Return values
void

parseConfigKey()

Parse a key into namespace, group, and item.

public parseConfigKey(string $key) : array<string|int, mixed>
Parameters
$key : string
Return values
array<string|int, mixed>

parseKey()

Parse a key into namespace, group, and item.

public parseKey(string $key) : array<string|int, mixed>
Parameters
$key : string
Return values
array<string|int, mixed>

prepend()

Prepend a value onto an array configuration value.

public prepend(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
Return values
void

push()

Push a value onto an array configuration value.

public push(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
Return values
void

set()

Set a given configuration value.

public set(array<string|int, mixed>|string $key[, mixed $value = null ]) : void
Parameters
$key : array<string|int, mixed>|string
$value : mixed = null
Return values
void

setParsedKey()

Set the parsed value of a key.

public setParsedKey(string $key, array<string|int, mixed> $parsed) : void
Parameters
$key : string
$parsed : array<string|int, mixed>
Return values
void

callAfterLoad()

Call the after load callback for a namespace.

protected callAfterLoad(string $namespace, string $group, array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$namespace : string
$group : string
$items : array<string|int, mixed>
Return values
array<string|int, mixed>

getCollection()

Get the collection identifier.

protected getCollection(string $group[, string $namespace = null ]) : string
Parameters
$group : string
$namespace : string = null
Return values
string

keyParserParseBasicSegments()

Parse an array of basic segments.

protected keyParserParseBasicSegments(array<string|int, mixed> $segments) : array<string|int, mixed>
Parameters
$segments : array<string|int, mixed>
Return values
array<string|int, mixed>

keyParserParseSegments()

Parse an array of namespaced segments.

protected keyParserParseSegments(string $key) : array<string|int, mixed>
Parameters
$key : string
Return values
array<string|int, mixed>

load()

Load the configuration group for the key.

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

parseNamespacedSegments()

Parse an array of namespaced segments.

protected parseNamespacedSegments(string $key) : array<string|int, mixed>
Parameters
$key : string
Return values
array<string|int, mixed>

parsePackageSegments()

Parse the segments of a package namespace.

protected parsePackageSegments(string $key, string $namespace, string $item) : array<string|int, mixed>
Parameters
$key : string
$namespace : string
$item : string
Return values
array<string|int, mixed>

Search results