Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console][HttpKernel] Avoid reflection-based registration for command public services #22579

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2017

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Apr 29, 2017

Q A
Branch? 3.3
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #22410 (comment)
License MIT
Doc PR n/a

By mapping commands ids by their alias in console.command.ids (even if the alias is not registered in the container for public services), then skipping reflection if the predictable alias exists as a key of console.command.ids.

Please note that the whole command service registration process is far from ideal.
I'm working on changing this for 3.4 in a transparent way regarding end users, leveraging PSR-11 to make the console component DI friendly, allowing to register commands as true private services (no more public aliases) and providing laziness for those.

Copy link
Contributor

@GuilhemN GuilhemN left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this !

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Apr 29, 2017
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍

@fabpot
Copy link
Member

fabpot commented Apr 29, 2017

Thank you @chalasr.

@fabpot fabpot merged commit 6c1b384 into symfony:master Apr 29, 2017
fabpot added a commit that referenced this pull request Apr 29, 2017
…for command public services (chalasr)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console][HttpKernel] Avoid reflection-based registration for command public services

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22410 (comment)
| License       | MIT
| Doc PR        | n/a

By mapping commands ids by their alias in `console.command.ids` (even if the alias is not registered in the container for public services), then skipping reflection if the predictable alias exists as a key of `console.command.ids`.

Please note that the whole command service registration process is far from ideal.
I'm working on changing this for 3.4 in a transparent way regarding end users, leveraging PSR-11 to make the console component DI friendly, allowing to register commands as true private services (no more public aliases) and providing laziness for those.

Commits
-------

6c1b384 Avoid reflection-based registration for command public services
@chalasr chalasr deleted the console-useless-reflection branch April 29, 2017 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants