diff --git a/config/application.php b/config/application.php index d5d74acc3d..7a445fd329 100644 --- a/config/application.php +++ b/config/application.php @@ -29,7 +29,12 @@ * 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) + ->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']);