PHP Class Devise\Support\Config\EnvironmentFileManager

Show file Open project: devisephp/cms

Public Methods

Method Description
__construct ( Framework $Framework, $envFile = null ) Create a new settings manager
createIfNotExists ( ) : void Checks for existence of .env file, if not it creates a new one.
get ( string $file = null, boolean $settingsOnly = true ) : array Extract the settings from the env file it should be in format DB_HOST=something and take up no more than one line
merge ( array $settings ) : [type] Merge in environment settings
save ( array $settings ) : array This will save the settings to the env file

Method Details

__construct() public method

Create a new settings manager
public __construct ( Framework $Framework, $envFile = null )
$Framework Devise\Support\Framework

createIfNotExists() public method

Checks for existence of .env file, if not it creates a new one.
public createIfNotExists ( ) : void
return void

get() public method

Extract the settings from the env file it should be in format DB_HOST=something and take up no more than one line
public get ( string $file = null, boolean $settingsOnly = true ) : array
$file string
$settingsOnly boolean
return array

merge() public method

Merge in environment settings
public merge ( array $settings ) : [type]
$settings array
return [type]

save() public method

This will save the settings to the env file
public save ( array $settings ) : array
$settings array
return array