PHP Class Autarky\Config\FileStore

Reads files from one or multiple directories, with the possibility of cascading for different environments and overriding of namespaces.
Inheritance: implements Autarky\Config\ConfigInterface
Datei anzeigen Open project: autarky/framework

Protected Properties

Property Type Description
$data array The loaded config data.
$environment string The current environment.
$loaderFactory LoaderFactory The loader factory instance.
$pathResolver Autarky\Files\PathResolver The path resolver instance.

Public Methods

Method Description
__construct ( Autarky\Files\PathResolver $pathResolver, LoaderFactory $loaderFactory, string | null $environment = null ) Constructor.
get ( $key, $default = null )
getLoaderFactory ( ) : LoaderFactory Get the loader factory instance.
has ( $key )
mount ( $location, $path )
set ( $key, $value )
setEnvironment ( $environment )

Protected Methods

Method Description
getBasename ( $key )
getDataFromFile ( $path )
getPaths ( $basename )
loadData ( $key )

Method Details

__construct() public method

Constructor.
public __construct ( Autarky\Files\PathResolver $pathResolver, LoaderFactory $loaderFactory, string | null $environment = null )
$pathResolver Autarky\Files\PathResolver
$loaderFactory LoaderFactory
$environment string | null

get() public method

public get ( $key, $default = null )

getBasename() protected method

protected getBasename ( $key )

getDataFromFile() protected method

protected getDataFromFile ( $path )

getLoaderFactory() public method

Get the loader factory instance.
public getLoaderFactory ( ) : LoaderFactory
return LoaderFactory

getPaths() protected method

protected getPaths ( $basename )

has() public method

public has ( $key )

loadData() protected method

protected loadData ( $key )

mount() public method

public mount ( $location, $path )

set() public method

public set ( $key, $value )

setEnvironment() public method

public setEnvironment ( $environment )

Property Details

$data protected_oe property

The loaded config data.
protected array $data
return array

$environment protected_oe property

The current environment.
protected string $environment
return string

$loaderFactory protected_oe property

The loader factory instance.
protected LoaderFactory,Autarky\Config $loaderFactory
return LoaderFactory

$pathResolver protected_oe property

The path resolver instance.
protected PathResolver,Autarky\Files $pathResolver
return Autarky\Files\PathResolver