From dd06d6dd2fc5add1b5da0ca34ba4cdc8ad52e8e2 Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Thu, 27 May 2021 23:06:19 -0400 Subject: [PATCH] Support .env.local config override If `.env.local` exists, any values will override and take precedence over those in `.env`. This is meant for local development only. --- config/application.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/application.php b/config/application.php index d558a856a2..b108e5ea34 100644 --- a/config/application.php +++ b/config/application.php @@ -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']);