Env
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. |
|
static protected Closure[] | $customAdapters | The list of custom adapters for loading environment variables. |
Methods
static void
enablePutenv()
Enable the putenv adapter.
static void
disablePutenv()
Disable the putenv adapter.
static void
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.
static void
disablePutenv()
Disable the putenv adapter.
static void
extend(Closure $callback, string|null $name = null)
Register a custom adapter creator Closure.
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 protected Option|Some
getOption(string $key)
Get the possible option for this environment variable.