Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] Deprecate the "--env" and "--no-debug" console options #28653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2018

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Sep 30, 2018

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

See #23343 (comment)

@chalasr chalasr added this to the next milestone Sep 30, 2018
@chalasr chalasr force-pushed the depr-nodebug-env-opts branch 4 times, most recently from 48a49e1 to 2f92fdd Compare September 30, 2018 19:48
@chalasr chalasr changed the title [FrameworkBundle] Deprecate the "--env" and "--no-debug" console options [Console] Deprecate the "--env" and "--no-debug" options Sep 30, 2018
@chalasr chalasr force-pushed the depr-nodebug-env-opts branch from 2f92fdd to 399b5ac Compare September 30, 2018 19:51
Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add a note in the UPGRADE/CHANGELOG files

@chalasr chalasr force-pushed the depr-nodebug-env-opts branch from 399b5ac to 01c4720 Compare October 1, 2018 21:40
@chalasr chalasr changed the title [Console] Deprecate the "--env" and "--no-debug" options [FrameworkBundle] Deprecate the "--env" and "--no-debug" console options Oct 1, 2018
@chalasr
Copy link
Member Author

chalasr commented Oct 1, 2018

@fabpot done, thanks for the reminder.
Also moved to FrameworkBundle, I've been confused by the console recipe relying on them.

@chalasr chalasr force-pushed the depr-nodebug-env-opts branch 4 times, most recently from 161ea03 to 654aa3f Compare October 1, 2018 21:50
@chalasr chalasr force-pushed the depr-nodebug-env-opts branch from 654aa3f to 7f42065 Compare October 1, 2018 21:51
UPGRADE-5.0.md Outdated
@@ -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 deprecated,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 5.0 this option would removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, fixed

@chalasr chalasr force-pushed the depr-nodebug-env-opts branch from 7f42065 to 9f60ff8 Compare October 2, 2018 09:07
@chalasr chalasr modified the milestones: next, 4.2 Oct 2, 2018
@fabpot
Copy link
Member

fabpot commented Oct 3, 2018

Thank you @chalasr.

@fabpot fabpot merged commit 9f60ff8 into symfony:master Oct 3, 2018
fabpot added a commit that referenced this pull request Oct 3, 2018
…g" 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
-------

9f60ff8 [FrameworkBundle] Deprecate the "--env" and "--no-debug" options
@chalasr chalasr deleted the depr-nodebug-env-opts branch October 3, 2018 08:53
@weaverryan
Copy link
Member

weaverryan commented Oct 7, 2018

Can you open a docs issue / pr?

@chalasr
Copy link
Member Author

chalasr commented Oct 7, 2018

@weaverryan sorry, forgot about it. Just opened symfony/symfony-docs#10444

@gnugat
Copy link
Contributor

gnugat commented Oct 8, 2018

Hi, I can't seem to be able to find any explanations on this decision, is there a link to a discussion about it somewhere I could be pointed to?

Also BC breaks? has been set as n/a, shouldn't it have been set to "yes" as in Sf 5 scripts using the flag won't be working anymore? Or is it a "no" as currently the only thing we have is warning notice?

Thanks for you answers, and keep up the good work.

@ogizanagi
Copy link
Contributor

ogizanagi commented Oct 8, 2018

@gnugat : This was discussed a bit a long time ago. Here is a comment from Fabien mentioning this.
Note there is no BC break here, as it's still supported until 5.0. It'll be considered a BC break when removing it at time master becomes the v5 branch. For now, this is only a deprecation.

@gnugat
Copy link
Contributor

gnugat commented Oct 8, 2018

@ogizanagi thanks for the link, that's exactly what I was looking for (the description in this PR was empty). Also thanks for the explanation on the BC break policy 👍

@chalasr
Copy link
Member Author

chalasr commented Oct 8, 2018

@gnugat link added to the PR body, sorry about that

@c33s
Copy link

c33s commented Oct 24, 2018

this is really a bad decision, it makes the use on windows much more complicated. this is really a very bad DX.

php bin/console --env=dev
Symfony 3.4.12 (kernel: src, env: dev, debug: true)
(fully working symfony console with no errors)

vs

APP_ENV=dev php bin\console
'APP_ENV' is not recognized as an internal or external command,
operable program or batch file.

vs

λ cmd /V /C "set APP_ENV=dev&& php bin\console"
 [WARNING] Some commands could not be registered:
In EnvVarProcessor.php line 76:
  Environment variable not found: "DATABASE_URL_LEGACY".
Symfony 3.4.12 (kernel: src, env: dev, debug: true)
---snip---
In EnvVarProcessor.php line 76:
  Environment variable not found: "APP_SECRET".

also the handy autocomplete possibility with clink on windows and bash-completion on linux is gone with this change. environment variables are cool but not the holy grail for everything. there is a reason for having flags on commands. imagine you have to call all commands like this:

URL=http://example.com RECURSIVE=true OUTPUT_FILE=foo.html wget

please revert this.

@nicolas-grekas
Copy link
Member

@c33s can you please open a separate issue? Commenting on anything closed is likely going to get low traction.

@nicolas-grekas
Copy link
Member

Reverted in #29204

nicolas-grekas added a commit that referenced this pull request Nov 14, 2018
…-env and --no-debug console options (chalasr)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle][WebServerBundle] Revert deprecation of --env and --no-debug console options

This reverts commit 9f60ff8.
This reverts commit 31b5615.

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28984
| License       | MIT
| Doc PR        | -

Working on recipes with @weaverryan, we figured out that this deprecation is just making our life more difficult. Let's revert it.

Same as #29126, reverts #28745 and #28653

Commits
-------

443f8ad [FrameworkBundle][WebServerBundle] Revert deprecation of --env and --no-debug console options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.