Skip to content

Commit

Permalink
Merge pull request #972 from spiral/hotfix/dotnev-bootloader
Browse files Browse the repository at this point in the history
Fixes loading ENV variables from dotenv in Kernel System section
  • Loading branch information
butschster authored Aug 16, 2023
2 parents 5e483c4 + 5c94261 commit c6e3798
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Bridge/Dotenv/src/Bootloader/DotenvBootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Spiral\DotEnv\Bootloader;

use Dotenv\Dotenv;
use Spiral\Boot\AbstractKernel;
use Spiral\Boot\Bootloader\Bootloader;
use Spiral\Boot\DirectoriesInterface;
use Spiral\Boot\EnvironmentInterface;
Expand All @@ -15,10 +14,10 @@ final class DotenvBootloader extends Bootloader
private bool $init = false;

public function init(
AbstractKernel $kernel,
DirectoriesInterface $dirs
DirectoriesInterface $dirs,
EnvironmentInterface $env,
): void {
$kernel->running(fn (EnvironmentInterface $env) => $this->loadEnvVariables($dirs, $env));
$this->loadEnvVariables($dirs, $env);
}

public function loadEnvVariables(DirectoriesInterface $dirs, EnvironmentInterface $env): void
Expand Down

0 comments on commit c6e3798

Please sign in to comment.