From 9f60ff8a4d80e86dff4891874a2cf531bd5ed847 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Sun, 30 Sep 2018 19:56:30 +0200 Subject: [PATCH] [FrameworkBundle] Deprecate the "--env" and "--no-debug" options --- UPGRADE-4.2.md | 4 ++++ UPGRADE-5.0.md | 4 ++++ src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 4 ++++ .../Bundle/FrameworkBundle/Console/Application.php | 8 ++++++++ 4 files changed, 20 insertions(+) diff --git a/UPGRADE-4.2.md b/UPGRADE-4.2.md index fbc956265d..25ba0caf08 100644 --- a/UPGRADE-4.2.md +++ b/UPGRADE-4.2.md @@ -110,6 +110,10 @@ FrameworkBundle ``` * The `ContainerAwareCommand` class has been deprecated, use `Symfony\Component\Console\Command\Command` with dependency injection instead. + * The `--env` console option and its "-e" shortcut have been deprecated, + set the "APP_ENV" environment variable instead. + * The `--no-debug` console option has been deprecated, + set the "APP_DEBUG" environment variable to "0" instead. Messenger --------- diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 5bebd035cc..a5b9c24ff5 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -116,6 +116,10 @@ FrameworkBundle * Added support for the SameSite attribute for session cookies. It is highly recommended to set this setting (`framework.session.cookie_samesite`) to `lax` for increased security against CSRF attacks. * The `ContainerAwareCommand` class has been removed, use `Symfony\Component\Console\Command\Command` with dependency injection instead. + * The `--env` console option and its "-e" shortcut have been removed, + set the "APP_ENV" environment variable instead. + * The `--no-debug` console option has been removed, + set the "APP_DEBUG" environment variable to "0" instead. HttpFoundation -------------- diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index f869066981..e2e5666489 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -14,6 +14,10 @@ CHANGELOG * Removed the `framework.messenger.encoder` and `framework.messenger.decoder` options. Use the `framework.messenger.serializer.id` option to replace the Messenger serializer. * Deprecated the `ContainerAwareCommand` class in favor of `Symfony\Component\Console\Command\Command` * Made `debug:container` and `debug:autowiring` ignore backslashes in service ids + * Deprecated the `--env` console option and its "-e" shortcut, set + the "APP_ENV" environment variable instead. + * Deprecated the `--no-debug` console option, set the "APP_DEBUG" + environment variable to "0" instead. 4.1.0 ----- diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php index bb420ba228..be733f995c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php @@ -62,6 +62,14 @@ class Application extends BaseApplication */ public function doRun(InputInterface $input, OutputInterface $output) { + if ($input->hasParameterOption(array('-e', '--env'), true)) { + @trigger_error('The "--env" option and its "-e" shortcut are deprecated since Symfony 4.2. Set the "APP_ENV" environment variable instead.', E_USER_DEPRECATED); + } + + if ($input->hasParameterOption('--no-debug', true)) { + @trigger_error('The "--no-debug" option is deprecated since Symfony 4.2. Set the "APP_DEBUG" environment variable to "0" instead.', E_USER_DEPRECATED); + } + $this->kernel->boot(); $this->setDispatcher($this->kernel->getContainer()->get('event_dispatcher'));