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] do not inline service factories#13914

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
fabpot merged 1 commit intosymfony:2.6fromxabbuh:issue-13913
Mar 17, 2015

Conversation

@xabbuh
Copy link
Member

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#13913
LicenseMIT
Doc PR

TheXmlDumper, which is used in the full-stack framework to dump the
used container, is not capable to dump inlined factories.

@xabbuh
Copy link
MemberAuthor

fixed tests (failures are not related to this pull request)

@nicolas-grekas
Copy link
Member

I've been hit by the bug, patch fixes the issue 👍

@fabpot
Copy link
Member

I would have preferred to actually inline the service instead of keeping it as a separate method.

@fabpot
Copy link
Member

hmmm, as this breaks the XML dump, we need a test for the XML dumper, to ensure we don't reintroduce the bug later on.

@xabbuh
Copy link
MemberAuthor

@fabpot What kind of behaviour would you expect in theXmlDumper when it gets passed an "inlined" service factory? Should it throw an exception?

@nicolas-grekas
Copy link
Member

XML-dumping a definition using a private factory fails without your patch, and works with. This could be tested.

@stof
Copy link
Member

I suggest adding a test taking each of our container fixture in the testsuite, compiling the container, and then dumping it as XML. this way, we would detect cases whichcannot be dumped

@xabbuh
Copy link
MemberAuthor

@nicolas-grekas The issue with your suggestion is that this is no related to theXmlDumper itself, but is related to how the instance looks like that is passed to it (i.e. the container as it has been modified by all compiler passes). So I added a test for theInlineServiceDefinitionPass which ensures that factories are not inlined.

@xabbuh
Copy link
MemberAuthor

@stof Doing so reveals that theXmlDumper also isn't capable of dumping inlined configurators (I suggested a way to dump them in#13557). Should I remove this possibility here too (given that adding such an option might be considered a new feature)?

The `XmlDumper`, which is used in the full-stack framework to dump theused container, is not capable to dump inlined factories.
@xabbuh
Copy link
MemberAuthor

By the way, most of the container fixtures were not usable because of undefined parameters. I added tests for the others though as you suggested.

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commit663ae9f intosymfony:2.6Mar 17, 2015
fabpot added a commit that referenced this pull requestMar 17, 2015
…buh)This PR was merged into the 2.6 branch.Discussion----------[DependencyInjection] do not inline service factories| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#13913| License       | MIT| Doc PR        |The `XmlDumper`, which is used in the full-stack framework to dump theused container, is not capable to dump inlined factories.Commits-------663ae9f do not inline service factories
@xabbuhxabbuh deleted the issue-13913 branchMarch 17, 2015 07:14
@xabbuh
Copy link
MemberAuthor

@fabpot Any opinion on the dumper (see the PR description)? I tend to adapt it as well in case someone uses the dumper without the parameter resolver pass (parameters in all other features seem to be resolved there too). What do you think?

fabpot added a commit that referenced this pull requestMar 23, 2015
…rs (xabbuh)This PR was merged into the 2.6 branch.Discussion----------[DependencyInjection] prevent inlining service configurators| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |Currently, only the `PhpDumper` is able to dump inlined serviceconfigurators. Since Symfony applications dump the compiled containerin XML, inlined configurators will break this process.We did something similar before with service factories in#13914.Commits-------34619fe prevent inlining service configurators
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@xabbuh@nicolas-grekas@fabpot@stof

[8]ページ先頭

©2009-2025 Movatter.jp