Skip to content

Commit

Permalink
Support .env.local config override
Browse files Browse the repository at this point in the history
If `.env.local` exists, any values will override and take precedence
over those in `.env`.

This is meant for local development only.
  • Loading branch information
swalkinshaw committed May 28, 2021
1 parent 6fe4c0e commit dd06d6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@

/**
* Use Dotenv to set required environment variables and load .env file in root
* .env.local will override .env if it exists
*/
$dotenv = Dotenv\Dotenv::createUnsafeImmutable($root_dir);
$dotenv = Dotenv\Dotenv::createUnsafeImmutable($root_dir, ['.env', '.env.local'], false);
if (file_exists($root_dir . '/.env')) {
$dotenv->load();
$dotenv->required(['WP_HOME', 'WP_SITEURL']);
Expand Down

0 comments on commit dd06d6d

Please sign in to comment.