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

Skip to content

[DoctrineBridge] deprecate doctrine schema subscribers in favor of listeners #49610

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
Mar 6, 2023

Conversation

alli83
Copy link
Contributor

@alli83 alli83 commented Mar 6, 2023

Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? yes
Tickets Fix #49387
License MIT
Doc PR

As @nicolas-grekas explained in #49387 (comment) :

" Because PdoSessionHandlerSchemaSubscriber is registered as a subscriber, ContainerAwareEventManager must instantiate it to know which events should be listened for. This triggers the instantiation of the session.handler service, which is a NativeFileSessionHandler, and this notice when this is done after headers have been sent."

It was therefore decided to change all the doctrine schema subscribers in favor of listeners in order to avoid this kind of problem.

Being already present before Symfony 6.3,
MessengerTransportDoctrineSchemaSubscriber, DoctrineDbalCacheAdapterSchemaSubscriber and RememberMeTokenProviderDoctrineSchemaSubscriberhave been deprecated.

TODO:

  • : update DoctrineBundle => in progress

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.

Nice, thanks :)

@alli83 alli83 force-pushed the doctrine-schema-as-listeners branch 7 times, most recently from 445e09c to b0400d5 Compare March 6, 2023 10:12
@alli83 alli83 force-pushed the doctrine-schema-as-listeners branch from b0400d5 to 787d569 Compare March 6, 2023 10:14
@nicolas-grekas
Copy link
Member

Thank you @alli83.

@nicolas-grekas nicolas-grekas merged commit 6858de9 into symfony:6.3 Mar 6, 2023
fabpot added a commit that referenced this pull request Apr 8, 2023
…s to ContainerAwareEventManager (alli83)

This PR was merged into the 6.3 branch.

Discussion
----------

[DoctrineBridge] Deprecate passing doctrine subscribers to ContainerAwareEventManager

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | Fix #49586
| License       | MIT
| Doc PR        |

Following issue #49586, this PR aims to deprecate passing doctrine subscribers to ContainerAwareEventManager. As mentioned, "[#[AsDoctrineListener]]... is a way better alternative anyway."

Following #49387 (comment),  in PR #49610 DoctrineSchemaSubscribers have already been deprecated in favor of listeners.

Commits
-------

c08780e [DoctrineBridge] Deprecate passing Doctrine subscribers to ContainerAwareEventManager, use listeners instead
@fabpot fabpot mentioned this pull request May 1, 2023
nicolas-grekas added a commit that referenced this pull request Jun 9, 2023
…nerAwareEventManager::getListeners()` deprecation (alexandre-daubois)

This PR was merged into the 7.0 branch.

Discussion
----------

[DoctrineBridge] Remove deprecated classes and `ContainerAwareEventManager::getListeners()` deprecation

| Q             | A
| ------------- | ---
| Branch?       | 7.0
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Removes deprecated code introduced in #49610

Commits
-------

746b123 [DoctrineBridge] Remove deprecated classes and `ContainerAwareEventManager::getListeners()` deprecation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants