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] Skip environment variables with false value in Process#25869

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:3.3fromfrancoispluchino:3.3
Jan 21, 2018
Merged

[Process] Skip environment variables with false value in Process#25869

nicolas-grekas merged 1 commit intosymfony:3.3fromfrancoispluchino:3.3
Jan 21, 2018

Conversation

@francoispluchino
Copy link
Contributor

@francoispluchinofrancoispluchino commentedJan 20, 2018
edited
Loading

QA
Branch?master, 4.0, 3.3, 3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets~
LicenseMIT
Doc PR~

With the commit03adce2, all env variables are injecting in the process, and the env variable with thefalse value are converted in empty string.

For example, it's problematic with the bundle SymfonyWebServerBundle and the last version of thesymfony/framework-bundle recipe, because the WebServer override the value ofAPP_ENV withfalse to override previously loaded variables (c5a1218), and with the commit03adce2, theAPP_ENV variable is injected with a empty string value, instead of not being injected, as was the case before.

This PR not use the same logic as thegetDefaultEnv() method.

$envPairs =array();
foreach ($envas$k =>$v) {
$envPairs[] =$k.'='.$v;
if (is_string($v)) {

Choose a reason for hiding this comment

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

Should be more specific IMHO. Eg numbers should not be filtered. false !== ?

Copy link
ContributorAuthor

@francoispluchinofrancoispluchinoJan 21, 2018
edited
Loading

Choose a reason for hiding this comment

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

Initially, this is the test I did to fix the problem, but after, I saw the test in thegetDefaultEnv() method. I also prefer to usefalse !== because it is more specific. I change that immediately.

@francoispluchinofrancoispluchino changed the title[Process] Inject only string environment variables in Process[Process] Skip environment variables with false value in ProcessJan 21, 2018
@francoispluchino
Copy link
ContributorAuthor

@nicolas-grekas It's updated.

@nicolas-grekas
Copy link
Member

Thank you@francoispluchino.

@nicolas-grekasnicolas-grekas merged commit2daf4f9 intosymfony:3.3Jan 21, 2018
nicolas-grekas added a commit that referenced this pull requestJan 21, 2018
…rocess (francoispluchino)This PR was merged into the 3.3 branch.Discussion----------[Process] Skip environment variables with false value in Process| Q             | A| ------------- | ---| Branch?       | master, 4.0, 3.3, 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | ~| License       | MIT| Doc PR        | ~With the commit03adce2, all env variables are injecting in the process, and the env variable with the `false` value are converted in empty string.For example, it's problematic with the bundle SymfonyWebServerBundle and the last version of the [symfony/framework-bundle recipe](https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/3.3/public/index.php#L11), because the WebServer override the value of `APP_ENV` with `false` to override previously loaded variables (c5a1218), and with the commit03adce2, the `APP_ENV` variable is injected with a empty string value, instead of not being injected, as was the case before.This PR not use the same logic as the [getDefaultEnv()](https://github.com/symfony/symfony/blob/4.0/src/Symfony/Component/Process/Process.php#L1553) method.Commits-------2daf4f9 [Process] Skip environment variables with false value in Process
@francoispluchino
Copy link
ContributorAuthor

@nicolas-grekas It's always a pleasure to help.

This was referencedJan 29, 2018
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

3.3

Development

Successfully merging this pull request may close these issues.

3 participants

@francoispluchino@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp