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 to the container debug command#26745

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

Closed
aaa2000 wants to merge1 commit intosymfony:masterfromaaa2000:container-debug

Conversation

@aaa2000
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes/no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#26295
LicenseMIT
Doc PRsymfony/symfony-docs#...

This PR try to list the tags that are applied on certain classes through autoconfiguration

sf debug:container --autoconfigure
Symfony Container Autoconfiguring Tags======================================"console.command" tag--------------------- * Symfony\Component\Console\Command\Command"config_cache.resource_checker" tag----------------------------------- * Symfony\Component\Config\ResourceCheckerInterface"container.env_var_processor" tag--------------------------------- * Symfony\Component\DependencyInjection\EnvVarProcessorInterface"container.service_locator" tag------------------------------- * Symfony\Component\DependencyInjection\ServiceLocator

}elseif ($parameter =$input->getOption('parameter')) {
$options =array('parameter' =>$parameter);
}elseif ($input->getOption('autoconfigure')) {
@unlink($this->getApplication()->getKernel()->getContainer()->getParameter('debug.container.dump'));
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The container dump doesn't contain the information concerning autoconfiguring tags. is it problematic? Is there another way? Should I pass an argument togetContainerBuilder to force a compilation ?

@linaori
Copy link
Contributor

Wouldn't it make more sense to show the full template of the autoconfigure? Autoconfigure works based on an interface(/class?), thus it would make sense to see what other configuration is being added by this.

@aaa2000
Copy link
ContributorAuthor

Sorry, I don't understand. What is the the full template of the autoconfigure ? Do you propose to display like this:

    _instanceof:        Symfony\Component\Security\Core\Authorization\Voter\VoterInterface:            tags: [security.voter]

or do you propose to display like the output of the commandphp ./bin/console debug:container App\\Security\\PostVoter with the information of autoconfigure ?

Information for Service "App\Security\PostVoter"================================================ ---------------- ------------------------   Option           Value                    ---------------- ------------------------   Service ID       App\Security\PostVoter    Class            App\Security\PostVoter    Tags             security.voter            Public           no                        Synthetic        no                        Lazy             no                        Shared           yes                       Abstract         no                        Autowired        yes                       Autoconfigured   yes                       Autoconfigure class Symfony\Component\Security\Core\Authorization\Voter\VoterInterface  Autoconfigure tag security.voter ---------------- ------------------------

@linaori
Copy link
Contributor

What about something like this?

Autoconfiguration for "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface"================================================ ---------------- ------------------------   Option           Value                    ---------------- ------------------------   Tags             security.voter  Public           no  Any other options and values etc. ---------------- ------------------------

@nicolas-grekasnicolas-grekas added this to the4.1 milestoneApr 4, 2018
@aaa2000
Copy link
ContributorAuthor

The command would have been useful to me during a migration of a project to the autowiring/autoconfigure.

Every time, I wondered if I could delete the configuration or not in services.yaml to reduce its size.

The command allows to know the autonconfiguring tags.
Which interface/class should be implemented to have autoconfiguration applied ?

If there is a need to know the full template, the commanddebug:container App\\Security\\PostVoter can be used. I have not yet meet the need to have the full template of the autoconfigure.

@nicolas-grekas
Copy link
Member

I really think such a command is a nice addition.
@iltar's comment is relevant especially now that autoconfiguration works for function calls (see#26768).

Maybe a separate command could be worth it?debug:autoconfiguration
by default it could display as@iltar suggests, and when the--tags is passed, be grouped by tags?

@nicolas-grekasnicolas-grekas modified the milestones:4.1,nextApr 29, 2018
@nicolas-grekas
Copy link
Member

rebase needed (needs to account for the new show-hidden option)

@aaa2000
Copy link
ContributorAuthor

@nicolas-grekas I create the separate command in#28730

@chalasr
Copy link
Member

Closing in favor of#28730

@chalasrchalasr closed thisOct 7, 2018
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
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

4.2

Development

Successfully merging this pull request may close these issues.

5 participants

@aaa2000@linaori@nicolas-grekas@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp