Core\Env
Reads the environment the program runs in: its environment variables, whether it runs in production or development, and facts about the system.
Members
5 members.
| Member | Signature |
|---|---|
get | get(string $name): ?tainted string |
secret | secret(string $name): ?secret string |
all | all(): array<tainted string> |
mode | mode(): Core\Env::Mode |
context | context(): Core\Env::Context |
Enums
ModeThe mode a program runs in. There are two modes. A mode sets the defaults of five settings, and you can still change each of those settings on its own.ContextThe kind of run the code is in.Core\Env::context()returns one of these seven cases.PlatformThe operating system family the program runs on.Core\Env::OSis one of these six cases.
Constants
Core\Env::EOLThe line ending this platform writes:\r\non Windows and\neverywhere else. Use it to write text in the platform's own format.Core\Str::linesandCore\IO::linesdo not use it, and split on all three line endings.Core\Env::OSThe operating system family, as aCore\Env::Platformcase. Compare it with a case, such asCore\Env::OS == Core\Env::Platform::Windows.Core\Env::VERSIONThis runtime's version: three numbers separated by dots, the same stringnvs infoprints. To compare versions, split it withCore\Str::splitand compare the numbers.
