class Env (View source)

Properties

static protected bool $putenv

Indicates if the putenv adapter is enabled.

static protected RepositoryInterface|null $repository

The environment repository instance.

Methods

static void
enablePutenv()

Enable the putenv adapter.

static void
disablePutenv()

Disable the putenv adapter.

static RepositoryInterface
getRepository()

Get the environment repository instance.

static mixed
get(string $key, mixed $default = null)

Get the value of an environment variable.

static mixed
getOrFail(string $key)

Get the value of a required environment variable.

static Option|Some
getOption(string $key)

Get the possible option for this environment variable.

Details

static void enablePutenv()

Enable the putenv adapter.

Return Value

void

static void disablePutenv()

Disable the putenv adapter.

Return Value

void

static RepositoryInterface getRepository()

Get the environment repository instance.

Return Value

RepositoryInterface

static mixed get(string $key, mixed $default = null)

Get the value of an environment variable.

Parameters

string $key
mixed $default

Return Value

mixed

static mixed getOrFail(string $key)

Get the value of a required environment variable.

Parameters

string $key

Return Value

mixed

Exceptions

RuntimeException

static protected Option|Some getOption(string $key)

Get the possible option for this environment variable.

Parameters

string $key

Return Value

Option|Some