8000 [HttpKernel] Make ErrorListener unaware of the event dispatcher by derrabus · Pull Request #35635 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] Make ErrorListener unaware of the event dispatcher #35635

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

Conversation

derrabus
Copy link
Member
@derrabus derrabus commented Feb 7, 2020
Q A
Branch? master
Bug fix? no
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

Under certain circumstances, HttpKernel's ErrorListener class might dynamically register and unregister a listener with the dispatcher. If our goal is to make the dispatcher immutable, that specific behavior would be in our way. Also, #34988 would break this workflow.

This PR provides an alternative. The listener is always registered, but I'm using the request to piggyback a flag that activates/deactivates the listener.

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.

with one minor comment

@derrabus derrabus force-pushed the improvement/make-error-listener-unaware-of-ed branch from 8c8ae6f to a9d1ded Compare February 7, 2020 14:36
@derrabus
Copy link
Member Author
derrabus commented Feb 7, 2020

Done. The Travis failure looks unrelated.

@fabpot
Copy link
Member
fabpot commented Feb 8, 2020

Thank you @derrabus.

fabpot added a commit that referenced this pull request Feb 8, 2020
…ispatcher (derrabus)

This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpKernel] Make ErrorListener unaware of the event dispatcher

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

Under certain circumstances, HttpKernel's `ErrorListener` class might dynamically register and unregister a listener with the dispatcher. If our goal is to make the dispatcher immutable, that specific behavior would be in our way. Also, #34988 would break this workflow.

This PR provides an alternative. The listener is always registered, but I'm using the request to piggyback a flag that activates/deactivates the listener.

Commits
-------

a9d1ded [HttpKernel] Make ErrorListener unaware of the event dispatcher.
@fabpot fabpot merged commit a9d1ded into symfony:master Feb 8, 2020
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
@fabpot fabpot mentioned this pull request May 5, 2020
@derrabus derrabus deleted the improvement/make-error-listener-unaware-of-ed branch March 13, 2021 15:22
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
0