class FileLoader implements LoaderInterface (View source)

Properties

protected Filesystem $files

The filesystem instance.

protected string $defaultPath

The default configuration path.

protected array $hints

All of the named path hints.

protected array $exists

A cache of whether namespaces and groups exists.

Methods

void
__construct(Filesystem $files)

Create a new file configuration loader.

array
defaultLoad(string $environment, string $group, string $namespace = null)

Load the given configuration group.

array
load(string $environment, string $group, string $namespace = null)

Non-namespaced order: /concrete/config/group.php /application/config/generated_overrides/group.php /application/config/group.php /application/config/environment.group.php.

array
mergeEnvironment(array $items, string $file)

Merge the items in the given file into the items.

bool
exists(string $group, string $namespace = null)

Determine if the given group exists.

array
cascadePackage(string $env, string $package, string $group, array $items)

Apply any cascades to an array of package options.

string
getPackagePath(string $env, string $package, string $group)

Get the package path for an environment and group.

string
getPath(string $namespace)

Get the configuration path for a namespace.

void
addNamespace(string $namespace, string $hint)

Add a new namespace to the loader.

clearNamespace($namespace)

Clear groups in a namespace

array
getNamespaces()

Returns all registered namespaces with the config loader.

mixed
getRequire(string $path)

Get a file's contents by requiring it.

Filesystem
getFilesystem()

Get the Filesystem instance.

Details

void __construct(Filesystem $files)

Create a new file configuration loader.

Parameters

Filesystem $files

Return Value

void

protected array defaultLoad(string $environment, string $group, string $namespace = null)

Load the given configuration group.

Parameters

string $environment
string $group
string $namespace

Return Value

array

array load(string $environment, string $group, string $namespace = null)

Non-namespaced order: /concrete/config/group.php /application/config/generated_overrides/group.php /application/config/group.php /application/config/environment.group.php.

Namespaced order: /path/to/namespace/group.php /path/to/namespace/environment.group.php /application/config/generated_overrides/namespace/group.php /application/config/namespace/group.php /application/config/namespace/environment.group.php

Parameters

string $environment
string $group
string $namespace

Return Value

array

protected array mergeEnvironment(array $items, string $file)

Merge the items in the given file into the items.

Parameters

array $items
string $file

Return Value

array

bool exists(string $group, string $namespace = null)

Determine if the given group exists.

Parameters

string $group
string $namespace

Return Value

bool

array cascadePackage(string $env, string $package, string $group, array $items)

Apply any cascades to an array of package options.

Parameters

string $env
string $package
string $group
array $items

Return Value

array

protected string getPackagePath(string $env, string $package, string $group)

Get the package path for an environment and group.

Parameters

string $env
string $package
string $group

Return Value

string

protected string getPath(string $namespace)

Get the configuration path for a namespace.

Parameters

string $namespace

Return Value

string

void addNamespace(string $namespace, string $hint)

Add a new namespace to the loader.

Parameters

string $namespace
string $hint

Return Value

void

clearNamespace($namespace)

Clear groups in a namespace

Parameters

$namespace

array getNamespaces()

Returns all registered namespaces with the config loader.

Return Value

array

protected mixed getRequire(string $path)

Get a file's contents by requiring it.

Parameters

string $path

Return Value

mixed

Filesystem getFilesystem()

Get the Filesystem instance.

Return Value

Filesystem