Env
class Env
Class Env
Handles loading and retrieving environment variables from a .env file.
Methods
static void
load(string $file)
Loads environment variables from a .env file.
static mixed
get(string $key, mixed $default = null)
Retrieves an environment variable.
Details
at line 28
static void
load(string $file)
Loads environment variables from a .env file.
This method reads the given file, parses the key-value pairs,
and stores them in the $variables array. It also ensures
that boolean and numeric values are converted appropriately.
at line 88
static mixed
get(string $key, mixed $default = null)
Retrieves an environment variable.
Looks up the requested key in the loaded environment variables. Returns the corresponding value or the specified default value if the key does not exist.