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

[FrameworkBundle] Add debug:autoconfigure command#31183

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

Conversation

@Simperfit
Copy link
Contributor

@SimperfitSimperfit commentedApr 19, 2019
edited
Loading

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#26295
LicenseMIT
Doc PRtodo

SEE for a complete output and more insight#28730

As far as I'm concerned, i've seen@ro0NL's comments on the PR, I think this is ready and working, we can tweak it, but letting the work from@aaa2000 being dead it not the right call IMHO. This is the the raw commit rebased with master and pushed.

maxhelias reacted with eyes emoji
@SimperfitSimperfit changed the titleAdd debug autoconfigure command[FrameworkBundle] Add debug autoconfigure commandApr 19, 2019
@nicolas-grekasnicolas-grekas added this to thenext milestoneApr 19, 2019
@OskarStark
Copy link
Contributor

Please use short array syntax 😊

Simperfit reacted with thumbs up emoji

@SimperfitSimperfitforce-pushed thefeature/add-debug-autoconfigue-command branch from4057f66 tof2dec47CompareApril 21, 2019 07:25
@SimperfitSimperfit marked this pull request as ready for reviewApril 21, 2019 07:42
@SimperfitSimperfitforce-pushed thefeature/add-debug-autoconfigue-command branch 2 times, most recently fromd81ee6c to4d7e67fCompareApril 21, 2019 15:03
@Simperfit
Copy link
ContributorAuthor

cc@chalasr

@Simperfit
Copy link
ContributorAuthor

AppVeyor failure seems not related

@Simperfit
Copy link
ContributorAuthor

cc@ro0NL@chalasr what can we do about this ? Do we refator the whole thing or just let this work die ?

Copy link
Contributor

@ro0NLro0NL left a comment

Choose a reason for hiding this comment

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

im still 👍 fordebug:autoconfiguration

/**
* @return ContainerBuilder
*/
privatefunctiongetContainerBuilder()
Copy link
Contributor

@ro0NLro0NLJul 19, 2019
edited
Loading

Choose a reason for hiding this comment

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

is the version fromContainerDebugCommand::getContainerBuilder() blocking for this implementation? extending fromContainerDebugCommand gives us things for free

{
$tagContainerBuilder =newContainerBuilder();
foreach ($tagContainerBuilder->getServiceIds()as$serviceId) {
$tagContainerBuilder->removeDefinition($serviceId);
Copy link
Contributor

Choose a reason for hiding this comment

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

isnt $tagContainerBuilder empty already 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's to make sure. And we could refactor it to be save empty and clone it on each call, no ?

$tagContainerBuilder->addDefinitions([$autoconfiguredInstanceofItem]);

$dumper =newYamlDumper($tagContainerBuilder);
preg_match('/calls\:\n((?: +- .+\n)+)/',$dumper->dump(),$matches);
Copy link
Contributor

Choose a reason for hiding this comment

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

no big fan of this approach, i'd opt for passing e.g.getMethodCalls() and render plain text as needed. Eventually could be inlined inexecute()

privatefunctiondumpTagAttribute(array$tagAttribute)
{
$cloner =newVarCloner();
$cliDumper =newCliDumper(null,null, AbstractDumper::DUMP_LIGHT_ARRAY);
Copy link
Contributor

Choose a reason for hiding this comment

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

#28898 is meant for this :)

Copy link
Contributor

@maxheliasmaxhelias left a comment

Choose a reason for hiding this comment

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

I was wondering if this kind of command existed, now i have the answer.

I'm totally 👍 for this feature.

I have some question

{
$tagContainerBuilder =newContainerBuilder();
foreach ($tagContainerBuilder->getServiceIds()as$serviceId) {
$tagContainerBuilder->removeDefinition($serviceId);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's to make sure. And we could refactor it to be save empty and clone it on each call, no ?

$container->registerForAutoconfiguration(ResetInterface::class)
->addTag('kernel.reset', ['method' =>'reset']);
->addTag('kernel.reset', ['method' =>'reset'])
->addTag('kernel.reset2', ['method' =>'reset2'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Would not it be a forgotten ? It seems strange to me

@Simperfit
Copy link
ContributorAuthor

will try to fix this tomorrow.

@maxhelias
Copy link
Contributor

Or maybe we can do like for#32584, add a option like--auto ?

@nicolas-grekasnicolas-grekas changed the base branch frommaster to4.4September 29, 2019 11:31
@nicolas-grekasnicolas-grekas changed the title[FrameworkBundle] Add debug autoconfigure command[FrameworkBundle] Add debug:autoconfigure commandSep 29, 2019
@nicolas-grekasnicolas-grekasforce-pushed thefeature/add-debug-autoconfigue-command branch from4d7e67f to09bb892CompareSeptember 29, 2019 12:04
@nicolas-grekas
Copy link
Member

I checked out the PR and here are two things that should be improved to me:

  • the output should be way more compact
  • thegetContainerBuilder() method in the command always compiles the container. Since this is a slow process, we'd better read from the dumped XML container (then, the command could extend fromContainerDebugCommand as doesDebugAutowiringCommand btw). This means we first need to dump autoconfigured types in the XML since they're not right now.

@Simperfit still available to work on this? Otherwise don't hesitate to call for help.

@Simperfit
Copy link
ContributorAuthor

@nicolas-grekas Thanks for the review, ill look into it this week.

@nicolas-grekas
Copy link
Member

Anyone willing to take over this one?

@atailouloute
Copy link
Contributor

@nicolas-grekas I can take over this if no one did.

@nicolas-grekas
Copy link
Member

Sure, please do!

@atailouloute
Copy link
Contributor

Should I create a new PR starting from this branch ? I don't think I have write access to Simperfit's repo

@nicolas-grekas
Copy link
Member

Please create another PR.

atailouloute reacted with thumbs up emoji

@chalasr
Copy link
Member

Closing in favor of#35033.

@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@ro0NLro0NLro0NL left review comments

@maxheliasmaxheliasmaxhelias left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.1

Development

Successfully merging this pull request may close these issues.

9 participants

@Simperfit@OskarStark@maxhelias@nicolas-grekas@atailouloute@chalasr@ro0NL@carsonbot@aaa2000

[8]ページ先頭

©2009-2025 Movatter.jp