PHP Environment

AbstractRead extends AbstractLoad
in package
implements ReadInterface

AbstractYes

This is a simple Read implementation that other Read can inherit from.

Table of Contents

Interfaces

ReadInterface
Describes Read interface.

Properties

$environments  : array<string, string>

Methods

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

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
bool

getEnvironments()

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
float

getInteger()

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
int

getString()

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
string

hasEnvironment()

Checks if environment variable exists by the given case-insensitive name.

public hasEnvironment(string $Name) : bool
Parameters
$Name : string

The variable name.

Return values
bool

load()

Return an instance with loaded data from array.

public load(array<string, mixed> $Data) : static
Parameters
$Data : array<string, mixed>

The load data.

Tags
throws
InvalidArgumentException

If error.

Return values
static

loadIni()

Return an instance with loaded data from ini file.

public loadIni(string $Filename) : static
Parameters
$Filename : string

The ini filename.

Tags
throws
InvalidArgumentException

If error.

Return values
static

loadJson()

Return an instance with loaded data from json file.

public loadJson(string $Filename) : static
Parameters
$Filename : string

The ini filename.

Tags
throws
InvalidArgumentException

If error.

Return values
static

getKey()

Retrieve normalized variable key.

protected getKey(string $Name) : string
Parameters
$Name : string

The variable name.

Return values
string

        
On this page

Search results