Skip to content

Commit e472606

Browse files
Merge pull request #742 from nicolas-grekas/req-autoloader
Require autoload.php in dump-env
2 parents 0e60b4c + 910f919 commit e472606

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Command/DumpEnvCommand.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7171
return $vars;
7272
7373
EOF;
74-
file_put_contents($path.'.local.php', $vars, LOCK_EX);
74+
file_put_contents($path.'.local.php', $vars, \LOCK_EX);
7575

7676
$this->getIO()->writeError('Successfully dumped .env files in <info>.env.local.php</>');
7777

@@ -84,6 +84,8 @@ private function loadEnv(string $path, ?string $env): array
8484
throw new \RuntimeException(sprintf('Please run "composer install" before running this command: "%s" not found.', $autoloadFile));
8585
}
8686

87+
require $autoloadFile;
88+
8789
if (!class_exists(Dotenv::class)) {
8890
throw new \RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
8991
}

0 commit comments

Comments
 (0)