diff --git a/bin/console b/bin/console index 5de0e1c5..8fe9d494 100755 --- a/bin/console +++ b/bin/console @@ -4,6 +4,7 @@ use App\Kernel; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Dotenv\Dotenv; use Symfony\Component\ErrorHandler\Debug; if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { @@ -14,8 +15,8 @@ set_time_limit(0); require dirname(__DIR__).'/vendor/autoload.php'; -if (!class_exists(Application::class)) { - throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.'); +if (!class_exists(Application::class) || !class_exists(Dotenv::class)) { + throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.'); } $input = new ArgvInput(); @@ -27,7 +28,7 @@ if ($input->hasParameterOption('--no-debug', true)) { putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0'); } -require dirname(__DIR__).'/config/bootstrap.php'; +(new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); if ($_SERVER['APP_DEBUG']) { umask(0000); diff --git a/symfony.lock b/symfony.lock index a71ed190..7d2081cf 100644 --- a/symfony.lock +++ b/symfony.lock @@ -477,16 +477,15 @@ "version": "v4.2.3" }, "symfony/console": { - "version": "4.4", + "version": "5.1", "recipe": { "repo": "github.com/symfony/recipes", "branch": "master", - "version": "4.4", - "ref": "ea8c0eda34fda57e7d5cd8cbd889e2a387e3472c" + "version": "5.1", + "ref": "c6d02bdfba9da13c22157520e32a602dbee8a75c" }, "files": [ - "./bin/console", - "./config/bootstrap.php" + "./bin/console" ] }, "symfony/contracts": {