Skip to content

Commit bbd02dc

Browse files
committed
feature #28653 [FrameworkBundle] Deprecate the "--env" and "--no-debug" console options (chalasr)
This PR was merged into the 4.2-dev branch. Discussion ---------- [FrameworkBundle] Deprecate the "--env" and "--no-debug" console options | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | n/a | Deprecations? | yes | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 9f60ff8a4d [FrameworkBundle] Deprecate the "--env" and "--no-debug" options
2 parents bbfec5f + 6f77123 commit bbd02dc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ CHANGELOG
1414
* Removed the `framework.messenger.encoder` and `framework.messenger.decoder` options. Use the `framework.messenger.serializer.id` option to replace the Messenger serializer.
1515
* Deprecated the `ContainerAwareCommand` class in favor of `Symfony\Component\Console\Command\Command`
1616
* Made `debug:container` and `debug:autowiring` ignore backslashes in service ids
17+
* Deprecated the `--env` console option and its "-e" shortcut, set
18+
the "APP_ENV" environment variable instead.
19+
* Deprecated the `--no-debug` console option, set the "APP_DEBUG"
20+
environment variable to "0" instead.
1721

1822
4.1.0
1923
-----

Console/Application.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ public function getKernel()
6262
*/
6363
public function doRun(InputInterface $input, OutputInterface $output)
6464
{
65+
if ($input->hasParameterOption(array('-e', '--env'), true)) {
66+
@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);
67+
}
68+
69+
if ($input->hasParameterOption('--no-debug', true)) {
70+
@trigger_error('The "--no-debug" option is deprecated since Symfony 4.2. Set the "APP_DEBUG" environment variable to "0" instead.', E_USER_DEPRECATED);
71+
}
72+
6573
$this->kernel->boot();
6674

6775
$this->setDispatcher($this->kernel->getContainer()->get('event_dispatcher'));

0 commit comments

Comments
 (0)