PHP Class Bluz\Config\Config

Author: Anton Shevchuk
Show file Open project: bluzphp/framework Class Usage Examples

Protected Properties

Property Type Description
$config configuration data
$environment environment
$modules modules configuration data
$path path to configuration files

Public Methods

Method Description
getData ( string | null $key = null, string | null $section = null ) : array | mixed Return configuration by key
getModuleData ( string $module, string $section = null ) : mixed Return module configuration by section
init ( ) : void Load configuration
setEnvironment ( string $environment ) : void Set application environment
setPath ( string $path ) : void Set path to configuration files

Protected Methods

Method Description
loadFile ( string $path ) : array Load configuration file
loadFiles ( string $path ) : array Load configuration files to array

Method Details

getData() public method

Return configuration by key
public getData ( string | null $key = null, string | null $section = null ) : array | mixed
$key string | null Key of config
$section string | null Section of config
return array | mixed

getModuleData() public method

Return module configuration by section
public getModuleData ( string $module, string $section = null ) : mixed
$module string
$section string
return mixed

init() public method

Load configuration
public init ( ) : void
return void

loadFile() protected method

Load configuration file
protected loadFile ( string $path ) : array
$path string
return array

loadFiles() protected method

Load configuration files to array
protected loadFiles ( string $path ) : array
$path string
return array

setEnvironment() public method

Set application environment
public setEnvironment ( string $environment ) : void
$environment string
return void

setPath() public method

Set path to configuration files
public setPath ( string $path ) : void
$path string
return void

Property Details

$config protected property

configuration data
protected $config

$environment protected property

environment
protected $environment

$modules protected property

modules configuration data
protected $modules

$path protected property

path to configuration files
protected $path