Skip to content

[Runtime] Fix dotenv_overload with commands #45426

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

Conversation

fancyweb
Copy link
Contributor

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? -
Tickets -
License MIT
Doc PR -

Fixes bugs introduced in #44997.

For example, if $_SERVER['APP_ENV'] = 'foo'; exists and with APP_ENV=prod in .env, any command will throw Cannot use "--env" or "-e" when the... because foo is considered as the input env.

Determining the input env and debug from $_SERVER is wrong because when the --no-debug and --env are not used, we actually consider the existing env and debug as the input end and debug. We need to know and use the real input env and debug.

@nicolas-grekas nicolas-grekas force-pushed the runtime/fix-overload-cmd-no-opts branch from f9de6bc to 4075269 Compare February 15, 2022 13:38
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(I made some tweaks)

@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

@nicolas-grekas nicolas-grekas merged commit 20111d2 into symfony:5.4 Feb 15, 2022
@fancyweb fancyweb deleted the runtime/fix-overload-cmd-no-opts branch February 15, 2022 13:40
This was referenced Feb 28, 2022
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.

3 participants