Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DependencyInjection] Fix support forfalse boolean env vars#50530

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:6.3fromokhoshi:di-false-env
Jun 9, 2023

Conversation

@okhoshi
Copy link
Contributor

QA
Branch?6.3
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

After upgradingsymfony/dependency-injection package to version 6.3, some of our env vars couldn't be found anymore.

For some scripts, we are providing an adhoc default value to env vars by setting$_SERVER directly. However, since version 6.3 of the DependencyInjection component, setting an env var tofalse (the boolean value, like in the snippet below) doesn't work anymore, and Symfony reports that the variable cannot be found.

$_SERVER['FOO'] =false;

It seems to be a side effect of the changes made in#48705.

@stof
Copy link
Member

stof commentedJun 1, 2023
edited
Loading

environment variables are always strings though. What you are covering in tests is not something compatible with actual environment variables (or with the DotEnv component).

@okhoshi
Copy link
ContributorAuthor

Because you can set any scalar value from PHP code, and they won't be converted to strings nor anything will prevent you to set them in the first place. FWIW, we've never had any troubles so far, be it with Symfony or DotEnv component.

I'm covering with tests because it was a supported behaviour that has been broken with 6.3 release. If you think it shouldn't have been supported from the start, and thus that this is not a bug, I'm also fine with that, feel free to let me know and close this PR.
But it's not really consistent then since any other scalar value will work.

@stof
Copy link
Member

stof commentedJun 1, 2023

It was not asupported behavior. It was anundefined behavior that happened to work.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment
edited
Loading

Choose a reason for hiding this comment

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

Works for me, I'm fine keeping the behavior from 6.2.

@nicolas-grekas
Copy link
Member

Thank you@okhoshi.

@nicolas-grekasnicolas-grekas merged commit87a65d8 intosymfony:6.3Jun 9, 2023
@okhoshiokhoshi deleted the di-false-env branchJune 13, 2023 18:11
@fabpotfabpot mentioned this pull requestJun 26, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.3

Development

Successfully merging this pull request may close these issues.

4 participants

@okhoshi@stof@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp