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 | Type | Description |
---|---|---|
$files | Illuminate\Filesystem\Filesystem |
Illuminate\Filesystem\Filesystem
|
$defaultPath | string |
string
|
Returns
void
public addNamespace (string $namespace, string $hint) : void
Add a new namespace to the loader.
Parameters
Property | Type | Description |
---|---|---|
$namespace | string |
string
|
$hint | string |
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 | Type | Description |
---|---|---|
$env | string |
string
|
$package | string |
string
|
$group | string |
string
|
$items | array |
array
|
Returns
array
public
exists (string $group, string $namespace = null
)
: bool
Determine if the given group exists.
Parameters
Property | Type | Description |
---|---|---|
$group | string |
string
|
$namespace | string |
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 | Type | Description |
---|---|---|
$environment | string |
string
|
$group | string |
string
|
$namespace | string |
string
|
Returns
array
public registerNamespaceAlias (string $namespace, string $alias) : void
Registers an alias for a given namespace.
Parameters
Property | Type | Description |
---|---|---|
$namespace | string |
string
|
$alias | string |
string
|
Returns
void
protected
getPackagePath (string $package, string $group, string $env = null
)
: string
Get the package path for an environment and group.
Parameters
Property | Type | Description |
---|---|---|
$package | string |
string
|
$group | string |
string
|
$env | string |
string
|
Returns
string
protected
getPath (string | null $namespace = null
)
: string | null
Get the configuration path for a namespace.
Parameters
Property | Type | Description |
---|---|---|
$namespace | string | null |
string | null
|
Returns
string | null
protected getRequire (string $path) : mixed
Get a file's contents by requiring it.
Parameters
Property | Type | Description |
---|---|---|
$path | string |
string
|
Returns
mixed
protected mergeEnvironment (array $items, string $file) : array
Merge the items in the given file into the items.
Parameters
Property | Type | Description |
---|---|---|
$items | array |
array
|
$file | string |
string
|
Returns
array
Copyright © 2024 Winter CMS