Download the PHP package into-the-void/env without Composer
On this page you can find all versions of the php package into-the-void/env. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download into-the-void/env
More information about into-the-void/env
Files in into-the-void/env
Package env
Short Description Read, parse and modify environment variables
License MIT
Homepage https://github.com/into-the-v0id/env.php
Informations about the package env
Env
Read, parse and modify environment variables
Installation
You can install this library via composer:
Example
You may also use the helper function instead of calling Env::get()
:
Behaviour
Repository
By default, environment variables are read via getenv(local_only: true)
and getenv()
. They are written via putenv()
, $_ENV
and $_SERVER
.
You may change this behaviour using Env::setRepository()
. Have a look at src/Repository for available Repositories.
Normalizer
If you want to strip spaces or quotes from your environment variables, then you may configure this via Env::setNormalizer()
. Have a look at src/Normalizer for available Normalizers.
This is not done by default, because your environment variables should not contain any unwanted spaces or quotes. If they do you probably should fix the declaration of those environment variables instead.
Parser
Nullish values (case insensitive): ''
, 'null'
, 'nil'
, 'none'
, 'undefined'
, 'empty'
Truthy values (case insensitive): '1'
, 'true'
, 'y'
, 'yes'
, 'on'
Falsy values (case insensitive): '0'
, 'false'
, 'n'
, 'no'
, 'off'
License
Copyright (C) Oliver Amann
This project is licensed under the MIT License (MIT). Please see LICENSE for more information.
All versions of env with dependencies
ext-mbstring Version *
ext-pcre Version *