const mixinafIocEnv::IocEnv

afIocEnv::IocEnv

@Js

(Service) - Holds the environment with some handy utility methods.

Although a mixin, implementations may still be created with the following:

iocEnv := IocEnv()

Or pass in an override:

iocEnv := IocEnv("prod")
abbr

Source

abstract Str abbr()

Returns the environment in abbreviated form; dev, test, prod. Or just the env in lowercase if not recognised.

env

Source

abstract Str env()

Returns the environment Str.

fromStr

Source

static new fromStr(Str? environmentOverride := null)

Create an IocEnv with the given (optional) environment override. This may be invoked via the ctor syntax:

iocEnv := IocEnv("prod")
isDev

Source

abstract Bool isDev()

Returns true if the environment is dev or development.

isEnv

Source

abstract Bool isEnv(Str env)

Returns true if the environment matches the given env in a case insensitive match.

isProd

Source

abstract Bool isProd()

Returns true if the environment is prod, production or undefined.

isStage

Source

abstract Bool isStage()

Returns true if the environment is test or testing.

isTest

Source

abstract Bool isTest()

Returns true if the environment is test or testing.

logToInfo

Source

abstract Void logToInfo()

Logs environment to info.