Skip to content

Commit

Permalink
Require autoload.php in dump-env
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Feb 16, 2021
1 parent 0e60b4c commit 910f919
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Command/DumpEnvCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <info>.env.local.php</>');

Expand All @@ -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.');
}
Expand Down

0 comments on commit 910f919

Please sign in to comment.