diff --git a/src/Command/DumpEnvCommand.php b/src/Command/DumpEnvCommand.php index d0a90bec9..ea2bde370 100644 --- a/src/Command/DumpEnvCommand.php +++ b/src/Command/DumpEnvCommand.php @@ -71,7 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int return $vars; EOF; - file_put_contents($path.'.local.php', $vars, LOCK_EX); + file_put_contents($path.'.local.php', $vars, \LOCK_EX); $this->getIO()->writeError('Successfully dumped .env files in .env.local.php'); @@ -84,6 +84,8 @@ private function loadEnv(string $path, ?string $env): array throw new \RuntimeException(sprintf('Please run "composer install" before running this command: "%s" not found.', $autoloadFile)); } + require $autoloadFile; + if (!class_exists(Dotenv::class)) { throw new \RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); }