diff --git a/config/application.php b/config/application.php index d5d74acc3d..c1d68befb1 100644 --- a/config/application.php +++ b/config/application.php @@ -29,7 +29,13 @@ * 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, ['.env', '.env.local'], false); +$repository = Dotenv\Repository\RepositoryBuilder::createWithNoAdapters() + ->addAdapter(Dotenv\Repository\Adapter\EnvConstAdapter::class) + ->addAdapter(Dotenv\Repository\Adapter\PutenvAdapter::class) + ->immutable() + ->make(); + +$dotenv = Dotenv\Dotenv::create($repository, $root_dir, ['.env', '.env.local'], false); if (file_exists($root_dir . '/.env')) { $dotenv->load(); $dotenv->required(['WP_HOME', 'WP_SITEURL']);