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

[DI] Fix resolving env vars when compiling a ContainerBuilder#23940

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.3fromnicolas-grekas:fix-env-resolve
Aug 21, 2017

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?3.3
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

As spotted by@ro0NL,$container->compile(true) doesn't resolve direct env var references found in service definitions. Fixed here.

/**
* Replaces env var placeholders by their current values.
*/
class ResolveEnvPlaceholdersPassextends AbstractRecursivePass
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

implementation is similar to the one in ResolveParameterPlaceHoldersPass

/**
* Replaces "%env(FOO)%" references by their placeholder, keeping regular "%parameters%" references as is.
*/
publicfunctionresolveEnvReferences(array$value)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Method has been introduced a few days ago, never released yet - thus no BC break here.

@ro0NL
Copy link
Contributor

@nicolas-grekas i reproduced the array-to-string conversion on 3.3 with$_ENV['REAL'] = array().

That now producesIllegal offset type in isset or empty in ContainerBuilder.php:1418. Considering getEnv returns mixed, it might need a patch :) The str_ireplace call seems fine looking at code.

The mixed runtime/compiletime works great now, inlucding leaving out default and/or real values. It just works as expected 👍

@nicolas-grekas
Copy link
MemberAuthor

array-to-string conversion

fixed, should be good then

@nicolas-grekasnicolas-grekas merged commit9219594 intosymfony:3.3Aug 21, 2017
nicolas-grekas added a commit that referenced this pull requestAug 21, 2017
…der (nicolas-grekas)This PR was merged into the 3.3 branch.Discussion----------[DI] Fix resolving env vars when compiling a ContainerBuilder| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -As spotted by@ro0NL, `$container->compile(true)` doesn't resolve direct env var references found in service definitions. Fixed here.Commits-------9219594 [DI] Fix resolving env vars when compiling a ContainerBuilder
@nicolas-grekasnicolas-grekas deleted the fix-env-resolve branchAugust 21, 2017 16:07
@fabpotfabpot mentioned this pull requestAug 28, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

3 participants

@nicolas-grekas@ro0NL@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp