Repository
class Repository extends Repository (View source)
Properties
protected LoaderInterface | $loader | The loader implementation. |
|
protected SaverInterface | $saver | The saver implementation. |
|
protected string | $environment | The current environment. |
|
protected array | $items | All of the configuration items. |
|
protected array | $packages | All of the registered packages. |
|
protected array | $afterLoad | The after load callbacks for namespaces. |
|
protected array | $parsed | A cache of the parsed items. |
Methods
Create a new configuration repository.
Determine if the given configuration value exists.
Determine if a configuration group exists.
Get the specified configuration value.
Set a given configuration value.
Save a key.
Clear specific key.
Clear cached items
Clear a namespace (Note: this deletes items permanently)
Load the configuration group for the key.
Call the after load callback for a namespace.
Parse an array of namespaced segments.
No description
Register a package for cascading configuration.
Get the configuration namespace for a package.
Register an after load callback for a given namespace.
Get the collection identifier.
Add a new namespace to the loader.
Returns all registered namespaces with the config loader.
Get the loader implementation.
Get the saver implementation
Get the current configuration environment.
Get the after load callback array.
Get all of the configuration items.
Parse a key into namespace, group, and item.
Parse an array of basic segments.
Set the parsed value of a key.
Details
__construct(LoaderInterface $loader, SaverInterface $saver, string $environment)
Create a new configuration repository.
bool
has(string $key)
Determine if the given configuration value exists.
bool
hasGroup(string $key)
Determine if a configuration group exists.
mixed
get(string $key, mixed $default = null)
Get the specified configuration value.
void
set(string $key, mixed $value = null)
Set a given configuration value.
bool
save($key, $value)
Save a key.
void
clear(string $key)
Clear specific key.
void
clearCache()
Clear cached items
void
clearNamespace($namespace)
Clear a namespace (Note: this deletes items permanently)
protected void
load(string $group, string $namespace, string $collection)
Load the configuration group for the key.
protected array
callAfterLoad(string $namespace, string $group, array $items)
Call the after load callback for a namespace.
protected array
parseNamespacedSegments(string $key)
Parse an array of namespaced segments.
protected
parsePackageSegments($key, $namespace, $item)
No description
package(string $package, string $hint = null, string $namespace = null)
Register a package for cascading configuration.
protected string
getPackageNamespace(string|Package $package, string $namespace)
Get the configuration namespace for a package.
void
afterLoading(string $namespace, Closure $callback)
Register an after load callback for a given namespace.
protected string
getCollection(string $group, string $namespace = null)
Get the collection identifier.
void
addNamespace(string $namespace, string $hint)
Add a new namespace to the loader.
array
getNamespaces()
Returns all registered namespaces with the config loader.
LoaderInterface
getLoader()
Get the loader implementation.
void
setLoader(LoaderInterface $loader)
Set the loader implementation.
SaverInterface
getSaver()
Get the saver implementation
setSaver(SaverInterface $saver)
Set the saver instance.
string
getEnvironment()
Get the current configuration environment.
array
getAfterLoadCallbacks()
Get the after load callback array.
array
getItems()
Get all of the configuration items.
array
parseKey(string $key)
Parse a key into namespace, group, and item.
protected array
parseBasicSegments(array $segments)
Parse an array of basic segments.
void
setParsedKey(string $key, array $parsed)
Set the parsed value of a key.