FileLoader

 class Winter\Storm\Config\FileLoader
implements 
    Winter\Storm\Config\LoaderInterface

Properties

protected $aliases : array

All of the namespace aliases.

protected $defaultPath : string

The default configuration path.

protected $exists : array

A cache of whether namespaces and groups exists.

protected $files : Illuminate\Filesystem\Filesystem

The filesystem instance.

protected $hints : array

All of the named path hints.

Methods

public __construct (Illuminate\Filesystem\Filesystem $files, string $defaultPath) : void

Create a new file configuration loader.

Parameters
Property Description
$files
Illuminate\Filesystem\Filesystem
$defaultPath
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 cascadePackage (string $env, string $package, string $group, array $items) : array

Apply any cascades to an array of package options.

Parameters
Property Description
$env
string
$package
string
$group
string
$items
array
Returns
array

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

Determine if the given group exists.

Parameters
Property Description
$group
string
$namespace
string
Returns
bool

public getFilesystem () : Illuminate\Filesystem\Filesystem

Get the Filesystem instance.

Returns
Illuminate\Filesystem\Filesystem

public getNamespaces () : array

Returns all registered namespaces with the config loader.

Returns
array

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

Load the given configuration group.

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

public registerNamespaceAlias (string $namespace, string $alias) : void

Registers an alias for a given namespace.

Parameters
Property Description
$namespace
string
$alias
string
Returns
void

protected getPackagePath (string $package, string $group, string $env = null) : string

Get the package path for an environment and group.

Parameters
Property Description
$package
string
$group
string
$env
string
Returns
string

protected getPath (string | null $namespace = null) : string | null

Get the configuration path for a namespace.

Parameters
Property Description
$namespace
string | null
Returns
string | null

protected getRequire (string $path) : mixed

Get a file's contents by requiring it.

Parameters
Property Description
$path
string
Returns
mixed

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

Merge the items in the given file into the items.

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