Environment Helper

This is a simple way to load environment configuration from environment variables.

$environment = new \Samy\Environment\Helper();

load

Return an instance with loaded data from array.

$environment = $environment->load($data);

loadIni

Return an instance with loaded data from INI file.

$environment = $environment->loadIni($filename);

getData

Retrieve all of environment variables.


$array = $environment->getData();

getString

Retrieve string value of environment variables.

$string = $environment->getString($name, $default = "");

getInteger

Retrieve integer value of environment variables.

$integer = $environment->getInteger($name, $default = 0);

getFloat

Retrieve float value of environment variables.

$float = $environment->getFloat($name, $default = 0);

getBoolean

Retrieve boolean value of environment variables.

$boolean = $environment->getBoolean($name, $default = false);