class CoreFileLoader extends FileLoader (View source)

A file loader specific to default core file loading.

This loader only loads the main config file and environment specific config.

Properties

protected Filesystem $files

The filesystem instance.

from  FileLoader
protected string $defaultPath

The default configuration path.

from  FileLoader
protected array $hints

All of the named path hints.

from  FileLoader
protected array $exists

A cache of whether namespaces and groups exists.

from  FileLoader

Methods

__construct(Filesystem $files, string $defaultPath = DIR_CORE_CONFIG)

Overridden constructor for the custom $defaultPath = ...

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

Load files from the core

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.

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.

Filesystem
getFilesystem()

Get the Filesystem instance.

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

Load the given configuration group.

array
mergeEnvironment(array $items, string $file)

Merge the items in the given file into the items.

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.

mixed
getRequire(string $path)

Get a file's contents by requiring it.

string[]
getNamespaceDefaultPaths(string $namespace)

No description

Details

__construct(Filesystem $files, string $defaultPath = DIR_CORE_CONFIG)

Overridden constructor for the custom $defaultPath = ...

Parameters

Filesystem $files
string $defaultPath

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

Load files from the core

Parameters

string $environment
string $group
string $namespace

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

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

Filesystem getFilesystem()

Get the Filesystem instance.

Return Value

Filesystem

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

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

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

protected mixed getRequire(string $path)

Get a file's contents by requiring it.

Parameters

string $path

Return Value

mixed

private string[] getNamespaceDefaultPaths(string $namespace)

No description

Parameters

string $namespace

Return Value

string[]