Skip to content

Commit

Permalink
Merge pull request #742 from nicolas-grekas/req-autoloader
Browse files Browse the repository at this point in the history
Require autoload.php in dump-env
  • Loading branch information
nicolas-grekas committed Feb 16, 2021
2 parents 0e60b4c + 910f919 commit e472606
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 e472606

Please sign in to comment.