October\Rain\Config\FileLoader

Source: ~/vendor/october/rain/src/Config/FileLoader.php

Implements:

Protected properties

protected Illuminate\Filesystem\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.

Public methods

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

Create a new file configuration loader.

Parameters
  • Illuminate\Filesystem\Filesystem $files
  • string $defaultPath

public void addNamespace(string $namespace, string $hint)

Add a new namespace to the loader.

Parameters
  • string $namespace
  • string $hint

public 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

public bool exists(string $group, string $namespace=NULL)

Determine if the given group exists.

Parameters
  • string $group
  • string $namespace

public Illuminate\Filesystem\Filesystem getFilesystem()

Get the Filesystem instance.

public array getNamespaces()

Returns all registered namespaces with the config loader.

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

Load the given configuration group.

Parameters
  • string $environment
  • string $group
  • string $namespace

Protected methods

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

Get the package path for an environment and group.

Parameters
  • string $env
  • string $package
  • string $group

protected string getPath(string $namespace)

Get the configuration path for a namespace.

Parameters
  • string $namespace

protected mixed getRequire(string $path)

Get a file's contents by requiring it.

Parameters
  • string $path

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

Merge the items in the given file into the items.

Parameters
  • array $items
  • string $file