Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 4, 2024 via composer

symfony/dotenv v7.0.2

Registers environment variables from a .env file
Package summary
Share
0
issues
1
license
1
MIT
Package created
12 Jan 2017
Version published
28 Dec 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
symfony/dotenv@v7.0.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of symfony/dotenv 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does symfony/dotenv do?

Symfony's dotenv component acts as a comprehensive solution for managing and registering environment variables from a .env file into your PHP application. The goal of Symfony dotenv is to parse .env files and make the environment variables within these files accessible through either $_SERVER or $_ENV.

How do you use symfony/dotenv?

Symfony's dotenv component is conveniently easy to use. Initiate by installing it through Composer using the command:

$ composer require symfony/dotenv

Once installed, you can load environment variables from your .env file with a block of PHP code that might look something like this:

use Symfony\Component\Dotenv\Dotenv;

$dotenv = new Dotenv();
$dotenv->load(__DIR__.'/.env');

Symfony's dotenv supports the loading of multiple .env files:

$dotenv->load(__DIR__.'/.env', __DIR__.'/.env.dev');

Overwriting already existing environment variables can be performed with the overload() method:

$dotenv->overload(__DIR__.'/.env');

Additionally, you can also load .env, .env.local, and .env.$APP_ENV.local or .env.$APP_ENV using the loadEnv() method:

$dotenv->loadEnv(__DIR__.'/.env');

It's crucial to remember to replace __DIR__.'/.env' with the actual path to your .env file.

Where are the symfony/dotenv docs?

The comprehensive documentation for Symfony's dotenv component is located in Symfony's main repository. For contributions, you can refer to Contributing, to report issues, you can visit Report issues and to send pull requests, navigate to send Pull Requests. All these resources are available in the main Symfony repository.