Skip to content

[FrameworkBundle] Deprecate session.storage service #40048

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
Feb 14, 2021

Conversation

jderusse
Copy link
Member

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? yes
Tickets -
License MIT
Doc PR TODO

Following the deprecation of session service, this PR deprecate other services that contains state: session.storage

  • session.storage
  • session.storage.native, session.storage.php_bridge and session.storage.mock_file
  • session.storage.metadata_bag

Because people can inject / decorate override all these services, providing a migration path like I did with session would have been very hard. That's why, I added a new opt-in flag:

When people use framework.session: true or framework.session.storage_id the previous behavior is kept and deprecation are triggered when accessing the services.
But when people use the new framework.session.storage_factory_id configuration, the previous services (session.storage.*) are deleted (in case people would try to inject the legacy session.storage* services and would have expect to manipulate the same objects as the object injected in the session)

@carsonbot
Copy link

Hey!

Great work. I told my friends about this PR, they too were impressed.

I think @mtarld has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@jderusse jderusse force-pushed the deprecate-session-2 branch from f69003f to 8e8fa6b Compare February 1, 2021 20:19
@ro0NL
Copy link
Contributor

ro0NL commented Feb 3, 2021

recipes should be updated as well 👍🏻

@jderusse jderusse force-pushed the deprecate-session-2 branch 2 times, most recently from e8e50ef to 624f422 Compare February 8, 2021 22:30
@jderusse jderusse force-pushed the deprecate-session-2 branch from 448911e to 37c5915 Compare February 13, 2021 14:59
@fabpot
Copy link
Member

fabpot commented Feb 14, 2021

Thank you @jderusse.

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.

7 participants