Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Dotenv | 3,584 | 5,464 | 1,176 | 4 days ago | 243 | April 01, 2022 | mit | PHP | ||
Registers environment variables from a .env file | ||||||||||
Dotenv Connector | 134 | 23 | 22 | 2 years ago | 20 | September 01, 2020 | 1 | mit | PHP | |
Makes values from a .env file available as environment variables for composer based projects | ||||||||||
Symfony Minimal Distribution | 74 | 7 years ago | mit | PHP | ||||||
This contains the code from my blog post http://whitewashing.de/2014/10/26/symfony_all_the_things_web.html | ||||||||||
Dynamicparametersbundle | 44 | 6 years ago | September 25, 2022 | mit | PHP | |||||
[UNMAINTAINED] Runtime retrieval of parameters from environment variables for Symfony | ||||||||||
Symfonyflex Bridge | 29 | 6 | 9 | 4 months ago | 15 | January 27, 2021 | 3 | mit | PHP | |
Bridge library for running Symfony Flex on Platform.sh | ||||||||||
Symfony5 | 8 | a year ago | mit | PHP | ||||||
Symfony 5 template for Platform.sh. | ||||||||||
Magento Dotenv | 5 | a year ago | 4 | April 01, 2022 | mit | PHP | ||||
Magento 2 Environment Variable Component - Implementing Symfony Dotenv | ||||||||||
Shh | 2 | 2 years ago | PHP | |||||||
A small package to handle secrets. | ||||||||||
Consul Php Envvar | 2 | 5 years ago | 1 | mit | PHP | |||||
Define missing environment variables from Consul KV and expose them in Symfony 3.2+ containers |
Symfony Dotenv parses .env
files to make environment variables stored in them
accessible via $_SERVER
or $_ENV
.
$ composer require symfony/dotenv
use Symfony\Component\Dotenv\Dotenv;
$dotenv = new Dotenv();
$dotenv->load(__DIR__.'/.env');
// you can also load several files
$dotenv->load(__DIR__.'/.env', __DIR__.'/.env.dev');
// overwrites existing env variables
$dotenv->overload(__DIR__.'/.env');
// loads .env, .env.local, and .env.$APP_ENV.local or .env.$APP_ENV
$dotenv->loadEnv(__DIR__.'/.env');