VirtualEnvironment
extends AbstractVirtualEnvironment
in package
Simple Virtual Environment implementation.
Table of Contents
Properties
- $environments : array<string, string>
Methods
- __construct() : mixed
- getBoolean() : bool
- Retrieve boolean value of environment variable by the given case-insensitive name.
- getEnvironments() : array<string, string>
- Retrieve all of environment variables.
- getFloat() : float
- Retrieve float value of environment variable by the given case-insensitive name.
- getInteger() : int
- Retrieve integer value of environment variable by the given case-insensitive name.
- getString() : string
- Retrieve string value of environment variable by the given case-insensitive name.
- hasEnvironment() : bool
- Checks if environment variable exists by the given case-insensitive name.
- load() : static
- Return an instance with loaded data from array.
- loadIni() : static
- Return an instance with loaded data from ini file.
- loadJson() : static
- Return an instance with loaded data from json file.
- getKey() : string
- Retrieve normalized variable key.
Properties
$environments
protected
array<string, string>
$environments
= []
Methods
__construct()
public
__construct() : mixed
getBoolean()
Retrieve boolean value of environment variable by the given case-insensitive name.
public
getBoolean(string $Name[, bool $Default = false ]) : bool
Parameters
- $Name : string
-
The variable name.
- $Default : bool = false
-
The default value.
Return values
boolgetEnvironments()
Retrieve all of environment variables.
public
getEnvironments() : array<string, string>
Return values
array<string, string>getFloat()
Retrieve float value of environment variable by the given case-insensitive name.
public
getFloat(string $Name[, float $Default = 0 ]) : float
Parameters
- $Name : string
-
The variable name.
- $Default : float = 0
-
The default value.
Return values
floatgetInteger()
Retrieve integer value of environment variable by the given case-insensitive name.
public
getInteger(string $Name[, int $Default = 0 ]) : int
Parameters
- $Name : string
-
The variable name.
- $Default : int = 0
-
The default value.
Return values
intgetString()
Retrieve string value of environment variable by the given case-insensitive name.
public
getString(string $Name[, string $Default = "" ]) : string
Parameters
- $Name : string
-
The variable name.
- $Default : string = ""
-
The default value.
Return values
stringhasEnvironment()
Checks if environment variable exists by the given case-insensitive name.
public
hasEnvironment(string $Name) : bool
Parameters
- $Name : string
-
The variable name.
Return values
boolload()
Return an instance with loaded data from array.
public
load(array<string, mixed> $Data) : static
Parameters
- $Data : array<string, mixed>
-
The load data.
Tags
Return values
staticloadIni()
Return an instance with loaded data from ini file.
public
loadIni(string $Filename) : static
Parameters
- $Filename : string
-
The ini filename.
Tags
Return values
staticloadJson()
Return an instance with loaded data from json file.
public
loadJson(string $Filename) : static
Parameters
- $Filename : string
-
The ini filename.
Tags
Return values
staticgetKey()
Retrieve normalized variable key.
protected
getKey(string $Name) : string
Parameters
- $Name : string
-
The variable name.