Fabien Potencier 12888c9c46 Merge branch '4.4' into 5.2
* 4.4:
  [Console] Readd missing php-doc parameter for constructor
  Remove polyfills from Yaml and Dotenv
  [HttpFoundation] Fixed type mismatch
  Bump Symfony version to 4.4.29
  Update VERSION for 4.4.28
  Update CHANGELOG for 4.4.28
2021-07-29 08:18:06 +02:00
2021-01-27 11:01:46 +01:00
2017-01-12 08:39:44 -08:00
2021-07-29 08:18:06 +02:00
2021-07-29 08:18:06 +02:00
2021-01-01 10:24:35 +01:00
2018-11-11 20:48:54 +01:00
2021-05-26 13:20:16 +02:00

Dotenv Component

Symfony Dotenv parses .env files to make environment variables stored in them accessible via $_SERVER or $_ENV.

Getting Started

$ 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');

Resources

Description
⚠️ ARCHIVED: Original GitHub repository no longer exists. Preserved as backup on 2026-01-22T16:32:32.195Z
Readme MIT 770 KiB
Languages
PHP 100%