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

[Process] intersect with getenv() to populate default envs#44070

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:4.4fromnicolas-grekas:proc-getenv
Nov 16, 2021

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#44066
LicenseMIT
Doc PR-

@nicolas-grekasnicolas-grekas merged commite70ad34 intosymfony:4.4Nov 16, 2021
@nicolas-grekasnicolas-grekas deleted the proc-getenv branchNovember 16, 2021 15:12
This was referencedNov 18, 2021
Comment on lines +1674 to +1675
$env =getenv();
$env =array_intersect_key($env,$_SERVER) ?:$env;
Copy link
Member

Choose a reason for hiding this comment

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

This means if the current running process has added env vars putenv(), they still won't be detected though. One has to update $_SERVER + do putenv() for it to be taken into account.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

That's right, we are intentionally not compatible with putenv() here, because using putenv leads to blank pages in Windows

$env = [];

foreach ($_SERVERas$k =>$v) {
if (\is_string($v) &&false !==$v =getenv($k)) {
Copy link

@devsidevsiNov 23, 2021
edited
Loading

Choose a reason for hiding this comment

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

Removal of the is_string check seems to be allowing arrays to get in to the env array as values. This causes an error "ErrorException Array to string conversion" when the env vars are read as a string in the start() method()

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Already fixed, see#44208
Please create issue instead of commenting on closed PRs to report issue btw.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

+2 more reviewers

@SeldaekSeldaekSeldaek left review comments

@devsidevsidevsi left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@Seldaek@stof@devsi@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp