class EnvironmentDetector (View source)

Methods

string
detect(array|string $environments, array|null $consoleArgs = null)

Detect the application's current environment.

string
detectWebEnvironment(array|string $environments)

Set the application environment for a web request.

string
detectConsoleEnvironment(mixed $environments, array $args)

Set the application environment from command-line arguments.

string|null
getEnvironmentArgument(array $args)

Get the environment argument from the console.

bool
isMachine(string $name)

Determine if the name matches the machine name.

Details

string detect(array|string $environments, array|null $consoleArgs = null)

Detect the application's current environment.

Parameters

array|string $environments
array|null $consoleArgs

Return Value

string

protected string detectWebEnvironment(array|string $environments)

Set the application environment for a web request.

Parameters

array|string $environments

Return Value

string

protected string detectConsoleEnvironment(mixed $environments, array $args)

Set the application environment from command-line arguments.

Parameters

mixed $environments
array $args

Return Value

string

protected string|null getEnvironmentArgument(array $args)

Get the environment argument from the console.

Parameters

array $args

Return Value

string|null

bool isMachine(string $name)

Determine if the name matches the machine name.

Parameters

string $name

Return Value

bool